monolog-bundle: strange configuration parsing of monolog, ??? BC-break after release of 3.4.0 ???
symfony: ^3.4 monolog: 3.4.0
in the case i have something like this
monolog:
channels: ["cron", "slow"]
handlers:
main:
type: fingers_crossed
buffer_size: 1000
action_level: warning
handler: nested
excluded_404s:
- ^/
nested:
type: stream
path: "/tmp/logpipe"
level: debug
cron:
type: stream
path: "/tmp/logpipe"
channels: cron
level: debug
after merge of #271 monolog config is invalid because the parsed configuration is treated as group type instead of fingers_crossed
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 7
- Comments: 23 (7 by maintainers)
Commits related to this issue
- composer.json: symfony/monolog-bundle:3.4.0 is set as conflicted - see https://github.com/symfony/monolog-bundle/issues/309 — committed to shopsys/shopsys by deleted user 5 years ago
- composer.json: symfony/monolog-bundle:3.4.0 is set as conflicted - see https://github.com/symfony/monolog-bundle/issues/309 — committed to shopsys/shopsys by deleted user 5 years ago
- composer.json: symfony/monolog-bundle:3.4.0 is set as conflicted - see https://github.com/symfony/monolog-bundle/issues/309 — committed to shopsys/shopsys by deleted user 5 years ago
- composer.json: symfony/monolog-bundle >= 3.4.0 is set as conflicted (#1148) - see https://github.com/symfony/monolog-bundle/issues/309 — committed to shopsys/shopsys by boris-brtan 5 years ago
- composer.json: symfony/monolog-bundle >= 3.4.0 is set as conflicted (#1148) - see https://github.com/symfony/monolog-bundle/issues/309 — committed to shopsys/framework by boris-brtan 5 years ago
- composer.json: symfony/monolog-bundle >= 3.4.0 is set as conflicted (#1148) - see https://github.com/symfony/monolog-bundle/issues/309 — committed to shopsys/project-base by boris-brtan 5 years ago
- Fix excluded_http_codes not warning when used improperly, fixes #271 — committed to symfony/monolog-bundle by Seldaek 6 years ago
Looks like the same type of error after 3.4 upgrade :
I managed to reproduce it. Everything is well explained in this comment
And the following fix makes your application working (and more robust)
thanks @PetrHeinz
I don’t think we can do anything here. using
->performNoDeepMerging()will break too many applications.So you should unset the configuration that are not compatible with your handler:
@TamasSzigeti
You application can not boot:
Anyway, let take a step back on this issue.
What do you (all) have in mind when you configure monolog globally (
config/packages/monolog.yaml) then per env (config/packages/dev/monolog.yaml) ? What do you think symfony should do // What did you expect ?For now, symfony process configuration like following:
It loads the global configuration first:
Then it (try to) merges it with the env configuration:
So this results in something really strange. Which configuration should win? The last one? Why? This could be determined by the kernel though:
But anyway, what should be done? Should we drop all the previous configuration if a new configuration is met with the same name?
@COil Your usage of MonologBundle was incorrect, and someone added a check to ensure the configuration was correct. We have documented Our Backward Compatibility Promise. I may be wrong, but PR #271 did not violate this promise, isn’t?
This is not covered by the BC promise