mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-13 17:52:22 +00:00
Added client side logging (#9643)
This commit is contained in:
parent
a7c115877f
commit
507133c76e
5 changed files with 14 additions and 1 deletions
|
|
@ -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": "",
|
||||
|
|
|
|||
|
|
@ -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)}"`;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
|
||||
<script type="text/javascript" src="//cloudfront.loggly.com/js/loggly.tracker-latest.min.js" async></script>
|
||||
<!-- Translations -->
|
||||
<script type='text/javascript' src='/api/v3/i18n/browser-script'></script>
|
||||
</body>
|
||||
|
|
|
|||
9
website/client/libs/logging.js
Normal file
9
website/client/libs/logging.js
Normal file
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue