Improved rate limit log to mention IP
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 6 May 2014 19:34:28 +0000 (12:34 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 6 May 2014 19:34:28 +0000 (12:34 -0700)
* This could be useful for logged in users and subnet limits

Change-Id: I4ddfb08c4730ec5cc3aec82f20792bbc09a49338

includes/User.php

index f5768af..a1a4b24 100644 (file)
@@ -1698,7 +1698,8 @@ class User {
                        // Already pinged?
                        if ( $count ) {
                                if ( $count >= $max ) {
-                                       wfDebugLog( 'ratelimit', $this->getName() . " tripped! $key at $count $summary" );
+                                       wfDebugLog( 'ratelimit', "User '{$this->getName()}' " .
+                                               "(IP {$this->getRequest()->getIP()}) tripped $key at $count $summary" );
                                        $triggered = true;
                                } else {
                                        wfDebug( __METHOD__ . ": ok. $key at $count $summary\n" );