rdbms: In the query log, show the server name in the message
authorTim Starling <tstarling@wikimedia.org>
Thu, 25 Jul 2019 02:39:26 +0000 (12:39 +1000)
committerKrinkle <krinklemail@gmail.com>
Fri, 26 Jul 2019 15:31:45 +0000 (15:31 +0000)
So that it is possible to distinguish master queries from replica
queries. Useful when debugging issues such as T221763.

Change-Id: I38896efa46f2c7cf289e5bdc543a1692e251ec1d

includes/libs/rdbms/database/Database.php

index 60062fb..e58b5f5 100644 (file)
@@ -1343,7 +1343,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                // Avoid the overhead of logging calls unless debug mode is enabled
                if ( $this->getFlag( self::DBO_DEBUG ) ) {
                        $this->queryLogger->debug(
-                               "{method} [{runtime}s]: $sql",
+                               "{method} [{runtime}s] {db_host}: $sql",
                                [
                                        'method' => $fname,
                                        'db_host' => $this->getServer(),