New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting different log levels per log writer if desired. #13873
Conversation
@@ -70,6 +70,36 @@ | |||
return Logger::WARNING; | |||
}), | |||
|
|||
'log.level.file' => DI\factory(function (ContainerInterface $c) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there maybe a way to make this more generic? eg check if log_level_$writer
in config is defined and if so use it, otherwise use the regular level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not too important though if not trivial... maybe we could just have at least a reusable function for them as likely we won't be adding any other loggers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but we'd have to create a DefinitionSource like the IniConfigDefinitionSource and add it during container creation. Except this definition source would be specific to the Monolog plugin, so we'd also have to figure out how to make ContainerFactory extendable in a plugin, but it's used before plugins are loaded, etc, etc. I think it would turn very complicated pretty quickly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all good 👍
Haven't tested it but feel free to merge 👍 |
config/global.ini.php
Outdated
@@ -93,8 +93,14 @@ | |||
; log level, everything logged w/ this level or one of greater severity | |||
; will be logged. everything else will be ignored. possible values are: | |||
; ERROR, WARN, INFO, DEBUG | |||
; this setting will apply to every log writer, if there is no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence seems not to be complete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated it
No description provided.