Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Monolog] Really reset logger when calling logger::reset()#30410
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
lyrixx commentedFeb 28, 2019
looks like Fabbot is broken. Anyway, this patch is much better, because it actually does the work. BTW, introducing the method But it is still not perfect. ATM we rely on the fact that processors and handlers are shared among all loggers. But there is one logger per channel. So when we call Let me explain this a bit more. Let's consider this config: monolog:handlers:main:type:fingers_crossedaction_level:errorhandler:bufferbuffer_size:50channels:["!php"]buffer:type:bufferhandler:filefile:type:streampath:'%kernel.logs_dir%/%kernel.environment%.log'php:type:fingers_crossedaction_level:errorhandler:php_filebuffer_size:50channels:["php"]php_file:type:streampath:'%kernel.logs_dir%/%kernel.environment%-php.log' And with this PHP script: <?phprequire__DIR__.'/vendor/autoload.php';$k =newAppKernel('dev',true);$k->boot();$c =$k->getContainer();// (I had to patch SF to make theses services public)$c->get('monolog.logger.php')->debug('debug from php - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');$c->get('monolog.logger.consumer')->debug('debug from consumer - YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY');$c->get('monolog.logger.consumer')->reset();dump(['logger php' =>$c->get('monolog.logger.php'),'logger consumer' =>$c->get('monolog.logger.consumer')]); We can simulate our issue. In my consumer, I got In my application, I don't have this issue because our configuration is more classical. But I know some people are doing this kind of configuration. We need to know that :) |
fabpot commentedMar 4, 2019
Isn't it something we can do on 3.4? |
lyrixx commentedMar 5, 2019
fabpot commentedMar 5, 2019
Thank you@lyrixx. |
… (lyrixx)This PR was merged into the 4.2 branch.Discussion----------[Monolog] Really reset logger when calling logger::reset()| Q | A| ------------- | ---| Branch? | 4.2| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |Commits-------08a20ee [Monolog] Really reset logger when calling logger::reset()
Uh oh!
There was an error while loading.Please reload this page.