Added the handler_class option to customize a handler while keeping i… #557
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…ts original type.
This pull request adds support for specifying a custom handler class for Monolog handlers via configuration. This allows users to define which PHP class should be used for a handler, increasing flexibility and extensibility in logging configuration. The main changes include schema and config updates, as well as logic to validate and use the custom handler class if provided.
Configuration and Schema Updates:
handler_classattribute to the Monolog XML schema (monolog-1.0.xsd) to allow specifying a custom handler class in XML configuration.handler_classoption to the handler configuration tree inConfiguration.php, defaulting tonull.Handler Instantiation Logic:
MonologExtension.phpto use the specifiedhandler_classif provided, including a runtime check that the class exists, otherwise falling back to the default handler class for the given type.Sample