From: sbassett Date: Wed, 4 Dec 2019 20:19:52 +0000 (-0600) Subject: rdbms: Log debug message traces as 'exception.trace' instead of 'trace' X-Git-Tag: 1.31.6~4^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=6fd8b71064f0d14ec3e44e20d69e60f8505ba3ba rdbms: Log debug message traces as 'exception.trace' instead of 'trace' Code cleanup and hardening (see also: T234014) of Database-related lib code in MediaWiki core. Bug: T233342 Change-Id: I3c968f4f5300374253dc80d99596cac50fbeb59e --- diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 2b5aaf59da..ab4ab68827 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -2235,7 +2235,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware if ( preg_match( '/(^|\s)(DISTINCT|JOIN|ON|AS)(\s|$)/i', $name ) !== 0 ) { $this->queryLogger->warning( __METHOD__ . ": use of subqueries is not supported this way.", - [ 'trace' => ( new RuntimeException() )->getTraceAsString() ] + [ 'exception' => new RuntimeException() ] ); return $name; @@ -3994,7 +3994,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware $fname . ': lost connection to {dbserver}; reconnected', [ 'dbserver' => $this->getServer(), - 'trace' => ( new RuntimeException() )->getTraceAsString() + 'exception' => new RuntimeException() ] ); } catch ( DBConnectionError $e ) { @@ -4510,8 +4510,8 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware */ public function __clone() { $this->connLogger->warning( - "Cloning " . static::class . " is not recomended; forking connection:\n" . - ( new RuntimeException() )->getTraceAsString() + "Cloning " . static::class . " is not recommended; forking connection", + [ 'exception' => new RuntimeException() ] ); if ( $this->isOpen() ) {