custom error logging on all skins #2873

merged 5 commits into from Mar 6, 2014


None yet

2 participants



Adding custom error logging/syslog functionality to all Wikia skins. @hakubo, since this would be new to the mobile skin, could you verify that this is OK to do?

@nmonterroso nmonterroso moving custom error logger to be included as part of WikiaSkinTopScri…
…pts hook instead of being hard coded in Oasis_Index

As this JavaScript code is moved to PHP, can we call AssetsManagerBaseBuilder::minifyJS to minify the snippet which is emitted on every page?


Added the call to AssetsManagerBaseBuilder::minifyJS()


@nmonterroso, calls to AssetsManagerBaseBuilder::minifyJS are quite heavy. Can it be cached?


We could add a memcache get/set in this codeblock, but I think this would be a lot of memcache requests that would hit only one memcache server. Currently we're serving about 110k requests/minute, most of which are non api requests, so they would have this block. Let's assume that it's about 60% of requests. I think that might be too many, but would want to hear what ops team thinks. @justinmhunter @johnsboyd @ljagiello ?


actually, looking at the amount of memcache gets/s on some of the memcaches this seems ok.

@macbre macbre and 1 other commented on an outdated diff Mar 4, 2014
@@ -120,4 +120,62 @@ public function alert($message, $context=[]) {
public function emergency($message, $context=[]) {
return $this->logger->emergency($message, $context);
+ public static function onWikiaSkinTopScripts(&$vars, &$scripts) {
+ global $wgDevelEnvironment, $wgIsGASpecialWiki, $wgEnableJavaScriptErrorLogging, $wgCacheBuster, $wgMemc;
+ if (!$wgDevelEnvironment) {
+ $onError = $wgIsGASpecialWiki || $wgEnableJavaScriptErrorLogging;
+ $key = "wikialogger-top-script-$wgCacheBuster-$onError";
macbre Mar 4, 2014

Is wgCacheBuster necessary in the key? It does not have any influence on the content of this inline script.

nmonterroso Mar 4, 2014

I think it is. In the case where we change the javascript, this JS would expire just like the rest of our JS does. Otherwise we'd have to wait until the cache expires (up to 24 hours) for the changes to take effect.

macbre Mar 6, 2014

This memcache key will contain compressed code that is inlined in PHP. We can simply modify the key every time it is changed. Otherwise, each push to production will invalidate the key.

nmonterroso Mar 6, 2014

Really doubt this makes a difference, but ok.

@nmonterroso nmonterroso merged commit cf20d61 into dev Mar 6, 2014
@nmonterroso nmonterroso deleted the BAC-811 branch Mar 6, 2014


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment