Last modified: 2013-11-21 21:08:33 UTC
MediaWiki fatals occurring on the production cluster are formatted and logged by 'wmerrors', a PHP extension which Tim wrote. The output format is simple and clear, and it approximates the format of exceptions logged from within MediaWiki code. It is well-suited for flat log files. However, because the output format is not formally specified and does not adhere to a common data encoding standard, it's a bit tricky to process programmatically. It'd be nice to have some service in production that performs some intelligent grouping of fatals and produces useful reports and alerts, and to that end it'd be nice to have wmerrors output JSON instead. This isn't a blocker because we can decode the current output format using a few simple regular expressions. But encoding at the source would be more reliable and be subject to fewer idiosyncrasies. (Example: wmerrors calls PHP's Exception::getTraceAsString, which uses ellipses to indicate truncation; it'd be better to use Exception::getTrace, scrub the 'args' item from each frame, and encode the whole thing as a JSON array.) Once Iacda90fb is merged, it will be possible to log JSON-encoded exceptions from core, so parity between the two log formats (exception & fatal) can be maintained.