jenkins-bot has submitted this change and it was merged.
Change subject: Allow finer-grained control over debug logging via XWD
......................................................................
Allow finer-grained control over debug logging via XWD
As an aid for debugging issues in production, MediaWiki is configured to
special-case mw1017: log messages generated on that host are diverted to
an eponymous UDP log bucket on fluorine. This is very useful, but there are
a few issues with it:
- The additional logging has a nontrivial performance overhead, which makes
request profiling on mw1017 less useful.
- SPOF. There is no CODFW equivalent for mw1017's logging setup.
- The fact that _all_ requests to mw1017 are diverted into the same log bucket
actually makes debugging harder, because there are many more log messages to
sift through.
We can correct all three issues by tying the logging behavior to an
X-Wikimedia-Debug header attribute:
- Developers that want to profile a request can omit the 'log' attribute to
avoid the extra runtime overhead.
- There are four hosts (two in EQIAD, two in CODFW) that handle XWD requests.
- Making the special debug logging optional (and off by default) will reduce
the amount of "noise" in the log file.
Change-Id: Iabca8858ed0da3cbd194f267c23ce7c424082dee
---
M wmf-config/logging.php
1 file changed, 5 insertions(+), 3 deletions(-)
Approvals:
Ori.livneh: Looks good to me, approved
jenkins-bot: Verified
diff --git a/wmf-config/logging.php b/wmf-config/logging.php
index 9c6031a..6572928 100644
--- a/wmf-config/logging.php
+++ b/wmf-config/logging.php
@@ -33,10 +33,12 @@
$wgDebugDumpSql = true;
}
+// When the X-Wikimedia-Debug header is present and contains a 'log' attribute,
+// forward log messages in all channels to a special log bucket set aside for
+// debugging. See <https://wikitech.wikimedia.org/wiki/X-Wikimedia-Debug>.
if ( isset( $_SERVER['HTTP_X_WIKIMEDIA_DEBUG'] ) &&
- gethostname() === 'mw1017'
-) {
- $wgDebugLogFile = "udp://{$wmfUdp2logDest}/mw1017";
+ preg_match( '/\blog\b/i', $_SERVER['HTTP_X_WIKIMEDIA_DEBUG'] )
) {
+ $wgDebugLogFile = "udp://{$wmfUdp2logDest}/XWikimediaDebug";
$wmgDefaultMonologHandler = 'wgDebugLogFile';
}
--
To view, visit https://gerrit.wikimedia.org/r/278310
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iabca8858ed0da3cbd194f267c23ce7c424082dee
Gerrit-PatchSet: 3
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Gergő Tisza <[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