rdbms: Denormalize fname and errno in DBQuery log messages

Instead of:

> (Count: 2003)
> {fname}	{db_server}	{errno}	{error}	{sql1line}

It might now log:

> (Count: 1751)
> Error 1062 from MovePage::moveTo, {error} {sql1line} {db_server}

> (Count: 252)
> Error 1064 from MediaWiki:__construct, {error} {sql1line} {db_server}

Bug: T255202
Change-Id: I54c9f10dfdf2a2d316460b1f946863034769a819
This commit is contained in:
Timo Tijhof 2020-06-11 21:52:53 +01:00 committed by Krinkle
parent 29e4847f7d
commit 5b7e86df0c

View file

@ -1649,8 +1649,10 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
* @return DBError
*/
private function getQueryExceptionAndLog( $error, $errno, $sql, $fname ) {
// Information that instances of the same problem have in common should
// not be normalized (T255202).
$this->queryLogger->error(
"{fname}\t{db_server}\t{errno}\t{error}\t{sql1line}",
"Error $errno from $fname, {error} {sql1line} {db_server}",
$this->getLogContext( [
'method' => __METHOD__,
'errno' => $errno,