custom error logging on all skins #2873

Merged
merged 5 commits into from Mar 6, 2014

Projects

None yet

2 participants

@nmonterroso

@Wikia/platform-team
https://wikia-inc.atlassian.net/browse/BAC-811

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
3d8132c
@macbre

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

@nmonterroso

Added the call to AssetsManagerBaseBuilder::minifyJS()

@macbre

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

@nmonterroso

@macbre
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 ?

@nmonterroso

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
extensions/wikia/Logger/WikiaLogger.class.php
@@ -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
macbre Mar 4, 2014

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

@nmonterroso
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
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
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
@macbre

👍

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