jenkins-bot has submitted this change and it was merged.
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(-)
Approvals:
Legoktm: Looks good to me, but someone else must approve
MaxSem: Looks good to me, approved
jenkins-bot: Verified
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: merged
Gerrit-Change-Id: I7c6e3d5cd08b9976e6c2b36cf47ec92c4f1f60ec
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits