Skip to content
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

Merged
merged 3 commits into from Dec 19, 2018

Conversation

diosmosis
Copy link
Member

No description provided.

@diosmosis diosmosis added the Needs Review PRs that need a code review label Dec 18, 2018
@diosmosis diosmosis added this to the 3.8.0 milestone Dec 18, 2018
@@ -70,6 +70,36 @@
return Logger::WARNING;
}),

'log.level.file' => DI\factory(function (ContainerInterface $c) {
Copy link
Member

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?

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good 👍

@tsteur
Copy link
Member

tsteur commented Dec 18, 2018

Haven't tested it but feel free to merge 👍

@@ -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
Copy link
Contributor

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated it

@diosmosis diosmosis merged commit 1b895a3 into 3.x-dev Dec 19, 2018
@diosmosis diosmosis deleted the backend-specific-log-levels branch December 19, 2018 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants