diff --git a/config.json.example b/config.json.example index c217657c43..f2274ce940 100644 --- a/config.json.example +++ b/config.json.example @@ -71,6 +71,7 @@ }, "IAP_GOOGLE_KEYDIR": "/path/to/google/public/key/dir/", "LOGGLY_TOKEN": "token", + "LOGGLY_CLIENT_TOKEN": "token", "LOGGLY_ACCOUNT": "account", "PUSH_CONFIGS": { "GCM_SERVER_API_KEY": "", diff --git a/webpack/config/prod.env.js b/webpack/config/prod.env.js index 079252b8b8..ca5c502e1d 100644 --- a/webpack/config/prod.env.js +++ b/webpack/config/prod.env.js @@ -34,7 +34,7 @@ let env = { }, }; -'NODE_ENV BASE_URL GA_ID STRIPE_PUB_KEY FACEBOOK_KEY GOOGLE_CLIENT_ID AMPLITUDE_KEY PUSHER:KEY PUSHER:ENABLED' +'NODE_ENV BASE_URL GA_ID STRIPE_PUB_KEY FACEBOOK_KEY GOOGLE_CLIENT_ID AMPLITUDE_KEY PUSHER:KEY PUSHER:ENABLED LOGGLY_CLIENT_TOKEN' .split(' ') .forEach(key => { env[key] = `"${nconf.get(key)}"`; diff --git a/website/client/index.html b/website/client/index.html index 1b2cb7813f..14b019fe4a 100644 --- a/website/client/index.html +++ b/website/client/index.html @@ -20,6 +20,7 @@
+ diff --git a/website/client/libs/logging.js b/website/client/libs/logging.js new file mode 100644 index 0000000000..32b7132a53 --- /dev/null +++ b/website/client/libs/logging.js @@ -0,0 +1,9 @@ +export function setUpLogging () { + let _LTracker = window._LTracker || []; // eslint-disable-line + _LTracker.push({ // eslint-disable-line + logglyKey: process.env.LOGGLY_CLIENT_TOKEN, // eslint-disable-line no-process-env + sendConsoleErrors: true, + tag: 'ClientJS', + json: true, + }); +} diff --git a/website/client/main.js b/website/client/main.js index 6feee90679..4f4c9f24e5 100644 --- a/website/client/main.js +++ b/website/client/main.js @@ -7,6 +7,7 @@ import AppComponent from './app'; import { setup as setupAnalytics, } from 'client/libs/analytics'; +import { setUpLogging } from 'client/libs/logging'; import router from './router'; import getStore from './store'; import StoreModule from './libs/store'; @@ -32,6 +33,7 @@ Vue.use(i18n, {i18nData: window && window['habitica-i18n']}); Vue.use(StoreModule); Vue.use(BootstrapVue); +setUpLogging(); setupAnalytics(); // just create queues for analytics, no scripts loaded at this time const store = getStore();