-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[WebProfilerBundle] add extra data to logs panel #54445
base: 7.2
Are you sure you want to change the base?
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
$processors = $logger->getProcessors(); | ||
while ([] !== $logger->getProcessors()) { | ||
$logger->popProcessor(); | ||
} |
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.
Really not sure about this. Adding tag priority like suggested here symfony/monolog-bundle#455 might help
// Ensure the DebugLogger is the first processor as Monolog add processors in reverse order | ||
$logger->pushProcessor($this->processor); | ||
foreach ($processors as $processor) { | ||
$logger->pushProcessor($processor); | ||
} |
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.
For me this would deserve its own PR.. as this one only says "add extra data" and not "changes the order of procesors" :)
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.
Indeed, that's why I'm not 100% sure about this change. But if processors are left as is, DebugProcessor
is the very last to be pushed to the list, and it will not get extra data added by next processors (because of reverse order used by Monolog).
Do you see another way to do so ? Working on CompilerPass
looks pretty complex.
This is an attempt to add
extra
data toLogs
panel in profiler.I'm not convinced by this approch but I couldn't find another way to put
DebugProcessor
as last item. Doing so ensure that when logs are collected,extra
property contains all data from previous processors.I think this PR could help: symfony/monolog-bundle#455
Here's an example with
Symfony\Bridge\Monolog\Processor\WebProcessor
andMonolog\Processor\MemoryUsageProcessor
enabledTODO