Convert MWExceptionHandler to use structured logging
authorBryan Davis <bd808@wikimedia.org>
Sun, 24 May 2015 20:02:13 +0000 (22:02 +0200)
committerBryan Davis <bd808@wikimedia.org>
Thu, 16 Jul 2015 02:03:46 +0000 (21:03 -0500)
commit77a397125fd1b901c3141cbfe7084a7534ff881b
tree748f366ddedd23141bf052330d17968d22e14ff2
parent2fff57e8a1e2fbf8487dcb4206b7d8b35bca47a9
Convert MWExceptionHandler to use structured logging

Replace wfDebugLog() calls in MWExceptionHandler with direct use of
LoggerFactory and LoggerInterface. Logged exceptions are added to the
log message context.

LegacyLogger is also updated to append stack traces to any log event
when $wgLogExceptionBacktrace is true and the PSR-3 recommendation of
passing the exception as an 'exception' context item.

Handling of context data in LegacyLogger is expanded to support arrays,
exceptions and common object types.

Bug: T88649
Change-Id: I71499d895582bdea033a2516c902e23e38084080
includes/debug/logger/LegacyLogger.php
includes/exception/MWExceptionHandler.php
tests/phpunit/includes/debug/logger/LegacyLoggerTest.php