Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 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
javiereguiluz commentedJan 27, 2022
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! |
nicolas-grekas commentedJan 27, 2022
This could qualify as a bug fix IMHO. |
SVillette commentedJan 27, 2022
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"). publicfunctiongetProcessedLogs(){...$logs[] = [...'errorCounter' =>isset($rawLogData['errorCounter']) ?$rawLogData['errorCounter']->getValue() :1, ];...return$this->processedLogs =$logs;} {%macro render_log_message(category,log_index,log) %}... {%iflog.errorCountisdefinedandlog.errorCount>1 %} <spanclass="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. |
SVillette commentedJan 27, 2022
Finally, I want to add that a global search on |
javiereguiluz commentedFeb 4, 2022
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: