* @ingroup Database
*/
+namespace Wikimedia\Rdbms;
+
use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
use Wikimedia\ScopedCallback;
+use BagOStuff;
/**
* Basic DB load monitor with no external dependencies
$this->parent = $lb;
$this->srvCache = $srvCache;
$this->mainCache = $cache;
- $this->replLogger = new \Psr\Log\NullLogger();
+ $this->replLogger = new NullLogger();
$this->movingAveRatio = isset( $options['movingAveRatio'] )
? $options['movingAveRatio']
if ( !$conn ) {
$lagTimes[$i] = false;
$host = $this->parent->getServerName( $i );
- $this->replLogger->error( __METHOD__ . ": host $host is unreachable" );
+ $this->replLogger->error(
+ __METHOD__ . ": host {db_server} is unreachable",
+ [ 'db_server' => $host ]
+ );
continue;
}
$lagTimes[$i] = $conn->getLag();
if ( $lagTimes[$i] === false ) {
$host = $this->parent->getServerName( $i );
- $this->replLogger->error( __METHOD__ . ": host $host is not replicating?" );
+ $this->replLogger->error(
+ __METHOD__ . ": host {db_server} is not replicating?",
+ [ 'db_server' => $host ]
+ );
}
}