* @param Exception $e
*/
public static function logException( Exception $e ) {
- global $wgLogExceptionBacktrace;
-
if ( !( $e instanceof MWException ) || $e->isLoggable() ) {
$logger = LoggerFactory::getInstance( 'exception' );
$logger->error(
* @param string $channel
*/
protected static function logError( ErrorException $e, $channel ) {
- global $wgLogExceptionBacktrace;
-
// The set_error_handler callback is independent from error_reporting.
// Filter out unwanted errors manually (e.g. when MediaWiki\suppressWarnings is active).
$suppressed = ( error_reporting() & $e->getSeverity() ) === 0;
$json = self::jsonSerializeException( $e, false, FormatJson::ALL_OK );
if ( $json !== false ) {
$logger = LoggerFactory::getInstance( "{$channel}-json" );
- $logger->error( $json, array( 'private' => true ) );
+ $logger->error( $json, array( 'private' => true ) );
}
Hooks::run( 'LogException', array( $e, $suppressed ) );