BryanDavis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/321798

Change subject: Throttler: improve log message compatibility with Monolog logger
......................................................................

Throttler: improve log message compatibility with Monolog logger

The `type` log event attribute is used in Wikimedia production logging
to categorize log events by source (e.g. 'mediawiki', 'restbase', etc).
Adding a `type` key to the logging context overwrites the default value
of 'mediawiki'. Rename the key to `throttle` in the context and the
message template.

Change-Id: Ic274159774e43a8749f83c850fff7897956cf377
---
M includes/auth/Throttler.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/98/321798/1

diff --git a/includes/auth/Throttler.php b/includes/auth/Throttler.php
index f47c606..000b070 100644
--- a/includes/auth/Throttler.php
+++ b/includes/auth/Throttler.php
@@ -135,7 +135,7 @@
                                $this->cache->incr( $throttleKey );
                        } else { // throttled
                                $this->logRejection( [
-                                       'type' => $this->type,
+                                       'throttle' => $this->type,
                                        'index' => $index,
                                        'ip' => $ipKey,
                                        'username' => $username,
@@ -191,7 +191,7 @@
        }
 
        protected function logRejection( array $context ) {
-               $logMsg = 'Throttle {type} hit, throttled for {expiry} seconds 
due to {count} attempts '
+               $logMsg = 'Throttle {throttle} hit, throttled for {expiry} 
seconds due to {count} attempts '
                        . 'from username {username} and IP {ip}';
 
                // If we are hitting a throttle for >= warningLimit attempts, 
it is much more likely to be

-- 
To view, visit https://gerrit.wikimedia.org/r/321798
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic274159774e43a8749f83c850fff7897956cf377
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <bda...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to