From: Aaron Schulz Date: Fri, 8 Jun 2018 22:14:05 +0000 (-0700) Subject: Add more logging to ChronologyProtector::initPositions() X-Git-Tag: 1.34.0-rc.0~5143 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=9130b0395c2c1a0e39172b358169f28c1c29d13a;p=lhc%2Fweb%2Fwiklou.git Add more logging to ChronologyProtector::initPositions() Bug: T194403 Change-Id: I8f1ccb3c6e257ae48ae6bbecd8f2a8f51cd2ed41 --- diff --git a/includes/libs/rdbms/ChronologyProtector.php b/includes/libs/rdbms/ChronologyProtector.php index f5cef9eab7..72ca5901c2 100644 --- a/includes/libs/rdbms/ChronologyProtector.php +++ b/includes/libs/rdbms/ChronologyProtector.php @@ -43,6 +43,8 @@ class ChronologyProtector implements LoggerAwareInterface { protected $key; /** @var string Hash of client parameters */ protected $clientId; + /** @var string[] Map of client information fields for logging */ + protected $clientInfo; /** @var int|null Expected minimum index of the last write to the position store */ protected $waitForPosIndex; /** @var int Max seconds to wait on positions to appear */ @@ -81,6 +83,9 @@ class ChronologyProtector implements LoggerAwareInterface { : md5( $client['ip'] . "\n" . $client['agent'] ); $this->key = $store->makeGlobalKey( __CLASS__, $this->clientId, 'v2' ); $this->waitForPosIndex = $posIndex; + + $this->clientInfo = $client + [ 'clientId' => '' ]; + $this->logger = new NullLogger(); } @@ -308,7 +313,7 @@ class ChronologyProtector implements LoggerAwareInterface { [ 'cpPosIndex' => $this->waitForPosIndex, 'waitTimeMs' => $waitedMs - ] + ] + $this->clientInfo ); } else { $this->logger->warning( @@ -317,7 +322,7 @@ class ChronologyProtector implements LoggerAwareInterface { 'cpPosIndex' => $this->waitForPosIndex, 'indexReached' => $indexReached, 'waitTimeMs' => $waitedMs - ] + ] + $this->clientInfo ); } } else {