BryanDavis has uploaded a new change for review.

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

Change subject: Convert from wfErrorLog to MWLogger logging
......................................................................

Convert from wfErrorLog to MWLogger logging

Convert the use of the soon to be deprecated wfErrorLog() global
function to direct use of a MWLogger.

Change-Id: I7c6e3d5cd08b9976e6c2b36cf47ec92c4f1f60ec
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 11 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/82/180082/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index f660715..45ddfec 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -987,21 +987,24 @@
                $uri = ( ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] ) ? 
'https://' : 'http://' ) .
                        $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
                $xff = isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ? 
$_SERVER['HTTP_X_FORWARDED_FOR'] : '';
-               wfErrorLog(
+               $logger = MWLogger::getInstance( 'xff' );
+               // TODO: it would be nice to log this as actual structured data
+               // instead of this ad-hoc tab delimited format
+               $logger->debug(
                        gmdate( 'r' ) . "\t" .
                        "$uri\t" .
                        "$xff, {$_SERVER['REMOTE_ADDR']}\t" .
                        ( ( isset( $_REQUEST['wpSave'] ) && $_REQUEST['wpSave'] 
) ? 'save' : '' )
-                               . "\n",
-                       "udp://$wmfUdp2logDest/xff"
                );
                if ( $wgRequest->getIP() === '127.0.0.1' ) {
-                       wfErrorLog(
+                       $logger = MWLogger::getInstance( 'localhost' );
+                       // TODO: it would be nice to log this as actual 
structured data
+                       // instead of this ad-hoc tab delimited format
+                       $logger->debug(
                                gmdate( 'r' ) . "\t" .
                                wfHostname() .
                                "\t$xff, {$_SERVER['REMOTE_ADDR']}\t" .
-                               WebRequest::detectProtocol(),
-                               "udp://$wmfUdp2logDest/localhost"
+                               WebRequest::detectProtocol()
                        );
                }
        }
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index cb9af60..26f9562 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -4207,6 +4207,8 @@
                'FSFileBackend' => "udp://$wmfUdp2logDest/fsfilebackend", // - 
gilles for bug 73229
                'OAuth' => "udp://$wmfUdp2logDest/oauth",
                'xenon' => "udp://$wmfUdp2logDest/xenon",
+               'xff' => "udp://$wmfUdp2logDest/xff",
+               'localhost' => "udp://$wmfUdp2logDest/localhost",
        ),
 
        '+enwiki' => array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c6e3d5cd08b9976e6c2b36cf47ec92c4f1f60ec
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to