Skip to content

Commit

Permalink
feature #31509 [Monolog] Setup the LoggerProcessor after all other pr…
Browse files Browse the repository at this point in the history
…ocessor (lyrixx)

This PR was merged into the 4.4 branch.

Discussion
----------

[Monolog] Setup the LoggerProcessor after all other processor

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27426
| License       | MIT
| Doc PR        |

---

This is a bit strange but [`Monolog\Processor::pushProcessor()`](https://github.com/Seldaek/monolog/blob/ebb804e432e8fe0fe96828f30d89c45581d36d07/src/Monolog/Logger.php#L224-L229)  **prepend** the processor to the stack.

Since the Compiler Pass has a low priority, the `DebugProcessor` is always
the last one to be added to the stack, so the first one in it.

Commits
-------

429307d7cf [Monolog] Setup the LoggerProcessor after all other processor
  • Loading branch information
lyrixx committed Jun 3, 2019
2 parents bcadf83 + eea6d55 commit a27c842
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion FrameworkBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function build(ContainerBuilder $container)
$container->addCompilerPass(new RegisterReverseContainerPass(false), PassConfig::TYPE_AFTER_REMOVING);

if ($container->getParameter('kernel.debug')) {
$container->addCompilerPass(new AddDebugLogProcessorPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
$container->addCompilerPass(new AddDebugLogProcessorPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 2);
$container->addCompilerPass(new UnusedTagsPass(), PassConfig::TYPE_AFTER_REMOVING);
$container->addCompilerPass(new ContainerBuilderDebugDumpPass(), PassConfig::TYPE_BEFORE_REMOVING, -255);
$container->addCompilerPass(new CacheCollectorPass(), PassConfig::TYPE_BEFORE_REMOVING);
Expand Down

0 comments on commit a27c842

Please sign in to comment.