Page MenuHomePhabricator

Add time offset to debug log file and debug toolbar output
Open, MediumPublic


wfDebugLog() messages in the $wgDebugLog file are lacking time indications. It has neither date-timestamps (like the mediawiki error log file would), nor +0.01ms offset information (like profiling would).

This applies to the wgDebugToolbar feature as well.



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:47 AM
bzimport set Reference to bz73492.
bzimport added a subscriber: Unknown Object (MLST).

Change 173667 had a related patch set uploaded by saper:
Pass $wgDebugTimestamp info to debug console

  • shows how it can look like with a monospace font (and without)

    I checked just now on a plain install of MediaWiki using mediawiki-docker-dev and with DevelopmentSettings.php loaded from LocalSettings.php.

    I find that the error logs contain timestamps. Note that the $wgDebugTimestamps configuration variable is no longer supported as of MW 1.35. Timestamps are now enabled by default.

    root@mediawiki:/var/log/mediawiki# tail mw-error.log 
    2021-01-07 23:08:38 default: [087492a7347d43f06559ecd4] [no req]   ParseError from line 76 of …

    Checking the debug logs, I do not see timestamps there currently.

    root@mediawiki:/var/log/mediawiki# tail mw-debug-www.log 
    [DBConnection] Wikimedia\Rdbms\LBFactory::destroy: closing connection to database 'db-master'.
    Request ended normally
    root@mediawiki:/var/log/mediawiki# tail mw-debug-cli.log 
    [objectcache] MainWANObjectCache using store EmptyBagOStuff

    Checking the debug toolbar, indeed also no absolute or relative timestamps either:

    cap.png (678×2 px, 324 KB)

    Krinkle renamed this task from Restore $wgDebugTimestamps to wfDebugLog entries and the debug console to Add timestamps to debug log file and debug toolbar messages.Jan 8 2021, 1:00 AM
    Krinkle renamed this task from Add timestamps to debug log file and debug toolbar messages to Add time offset to debug log file and debug toolbar output.Sep 16 2021, 8:02 PM
    Krinkle removed a project: Patch-For-Review.
    Krinkle updated the task description. (Show Details)
    Krinkle removed a subscriber: bzimport.