Page MenuHomePhabricator

Debug log flooded with long error-json entries
Closed, ResolvedPublic


By default the $wgDebugComments = true; is almost useless because the log is full or long stacktraces of suppressed warnings. I think those should not be on the default log by default. I haven't found an easy way to get rid of them apart from editing the code.

Event Timeline

Nikerabbit raised the priority of this task from to Needs Triage.
Nikerabbit updated the task description. (Show Details)
Nikerabbit added subscribers: Nikerabbit, bd808.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 30 2015, 10:10 AM
bd808 added a subscriber: Krinkle.Dec 30 2015, 6:25 PM

In resolving T75619: Debug: Log group 'error' for PHP errors should abide wfSuppressWarnings, @Krinkle chose to emit log events for suppressed errors to the error-json log channel. In my opinion, suppressed errors should be discarded entirely. I don't understand the need to have an event stream to track events that are being deliberately ignored by the code authors.

Given the choice I'd remove the error-json and exception-json log channels entirely. With the introduction of PSR-3 log handling and the ability to use Monolog as the implementation library the operator of a given MediaWiki installation has the opportunity to configure various output formats for any log channel. This flexibility allows recording structured events when desired without incurring the overhead of additional string processing for deployments that are not interested in capturing the events.

There were some changes related to the handling of the $dest argument to wfDebug and wfDebugLog that have also effected the $wgDebugComments = true; behavior. The use of false, 'log', or 'private' for this argument (all non-default values) will no longer exclude the log event from being processed by MWDebug::debugMsg when MediaWiki\Logger\LegacyLogger is in use. Fixing this regression would remove the error-json noise as well as the messages to the error-json and exception-json channels are marked for exclusion via 'private' => true in the log event's context.

Change 261641 had a related patch set uploaded (by BryanDavis):
Exclude debug log events marked "private" from MWDebug

bd808 claimed this task.Dec 30 2015, 6:38 PM
Restricted Application added a project: User-bd808. · View Herald TranscriptDec 30 2015, 6:38 PM
bd808 triaged this task as Medium priority.Dec 30 2015, 6:38 PM
bd808 moved this task from To Do to Needs Review/Feedback on the User-bd808 board.

Change 261651 had a related patch set uploaded (by BryanDavis):
Remove use of $dest = 'log' for wfDebugLog

Change 261641 merged by jenkins-bot:
Exclude debug log events marked "private" from MWDebug

Change 261651 merged by jenkins-bot:
Remove use of $dest = 'log' for wfDebugLog

bd808 added a comment.Jan 21 2016, 4:04 PM

@Nikerabbit Are the changes I implemented sufficient to solve your original issue?

Nikerabbit closed this task as Resolved.Jan 22 2016, 8:49 AM

After removing my local hack to kill them, there is no flood in the debug output, which is good.

bd808 moved this task from Needs Review/Feedback to Done on the User-bd808 board.Feb 2 2016, 2:07 AM
bd808 moved this task from Done to Archive on the User-bd808 board.Feb 21 2016, 8:53 PM