From: Chad Horohoe Date: Wed, 1 Nov 2017 17:23:01 +0000 (-0700) Subject: Improve connection logging a little more X-Git-Tag: 1.31.0-rc.0~1622^2 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=720b08b291f91e5059d81642dbf6378963da0c4a;p=lhc%2Fweb%2Fwiklou.git Improve connection logging a little more Don't include the trace in the actual message, that keeps us from grouping these messages by type. Instead inject the trace as an extra parameter we'll pick up in logstash Change-Id: I48184c1af2560827ef50baff4fc0443f00697504 --- diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index a9dd07483f..e04566eb49 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -948,9 +948,8 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware $msg = __METHOD__ . ': lost connection to {dbserver}; reconnected'; $params = [ 'dbserver' => $this->getServer() ]; $this->connLogger->warning( $msg, $params ); - $this->queryLogger->warning( - "$msg:\n" . ( new RuntimeException() )->getTraceAsString(), - $params ); + $this->queryLogger->warning( $msg, $params + + [ 'trace' => ( new RuntimeException() )->getTraceAsString() ] ); if ( !$recoverable ) { # Callers may catch the exception and continue to use the DB