-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WebProfilerBundle] Display again the number of occurrences of log messages #45198
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
Conversation
As @SVillette pointed out to me via Symfony Slack, the current profiler before this PR already displayed the "log counter": So, the real problem might be that the log counter of LoggerProfiler doesn't work. @SVillette also mentioned that doing the following change in $logs[] = [
...
'errorCounter' => isset($rawLogData['errorCounter']) ? $rawLogData['errorCounter']->getValue() : 1,
'errorCount' => $rawLog['errorCount'] ?? 1, // The line I added to make it worked
...
]; I need help to know how to move forward with this. Thanks! |
This could qualify as a bug fix IMHO. |
Hi @nicolas-grekas, I will clarify a little about what has been done. The issue is not about global count ("15") but the count per log ("5 times"). public function getProcessedLogs()
{
...
$logs[] = [
...
'errorCounter' => isset($rawLogData['errorCounter']) ? $rawLogData['errorCounter']->getValue() : 1,
];
...
return $this->processedLogs = $logs;
} {% macro render_log_message(category, log_index, log) %}
...
{% if log.errorCount is defined and log.errorCount > 1 %}
<span class="log-num-occurrences">{{ log.errorCount }} times</span>
{% endif %}
...
{% endmacro %}
To reformulate what @javiereguiluz said, the template was already displaying the right information but the From what I debugged So that's why I just modified $logs[] = [
'errorCount' => $rawLog['errorCount'] ?? 1,
]; I hope my explanation are clear, I can open a PR if you consider it is a bug fix. |
Finally, I want to add that a global search on |
Closing in favor of a better fix in #45302. Thanks! |
…ot displayed in WebProfilerBundle (SVillette) This PR was merged into the 5.4 branch. Discussion ---------- [HttpKernel][WebProfilerBundle] Fixed error count by log not displayed in WebProfilerBundle | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #45183 | License | MIT | Doc PR | - This PR is the following of #45198. Refer to this PR for details.  Commits ------- 5e1a2cb [HttpKernel] Fixed error count by log not displayed in WebProfilerBundle
It looks like this: