From d49a02fd28913eb67d63d9c8bb48ce9d3e27733b Mon Sep 17 00:00:00 2001 From: Bradley Portnoy Date: Thu, 3 Dec 2015 15:42:52 -0800 Subject: [PATCH 1/2] Allow different tags on each log statement --- src/loggly.tracker.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/loggly.tracker.js b/src/loggly.tracker.js index 6f49d14..40ad09b 100644 --- a/src/loggly.tracker.js +++ b/src/loggly.tracker.js @@ -27,8 +27,15 @@ } function setTag(tracker, tag){ - tracker.tag = tag; - } + tracker.tag = tag; + if (tracker.mutableTags) { + setInputUrl(tracker); + } + } + + function setMutableTags(tracker) { + tracker.mutableTags = true; + } function setDomainProxy(tracker, useDomainProxy){ tracker.useDomainProxy = useDomainProxy; @@ -118,6 +125,10 @@ if(data.sendConsoleErrors !== undefined) { setSendConsoleError(self, data.sendConsoleErrors); } + + if (data.mutableTags) { + setMutableTags(self); + } if(data.tag) { setTag(self, data.tag); From 5e307edf4677851739ef3aebd3244f35197116b4 Mon Sep 17 00:00:00 2001 From: Bradley Portnoy Date: Fri, 4 Dec 2015 10:53:50 -0800 Subject: [PATCH 2/2] Add documentation of mutable tags feature --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 2058965..69a7850 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,19 @@ _LTracker.push({ }); ``` +By default, tags are set once and are then immutable. To enable changing the tag with each log statement, set `mutableTags` to true when initializing: + +```Javascript +_LTracker.push({ + 'logglyKey': 'your-customer-token', + 'sendConsoleErrors' : true, + 'tag' : 'tag1,tag2', + 'mutableTags' : true +}); +``` + +If mutable tags are enabled, any log object passed with a 'tag' key will overwrite the previous tags. + Setup Proxy for Ad blockers ---------- You can proxy the requests from your own domain if the script or its requests are blocked by Ad blockers. To do this, you need to perform following steps