feat: log to new relic
This commit is contained in:
@@ -21,6 +21,9 @@ import router, { initalizeRouter } from 'dashboard/routes';
|
||||
import store from 'dashboard/store';
|
||||
import constants from 'dashboard/constants/globals';
|
||||
import * as Sentry from '@sentry/vue';
|
||||
import { BrowserAgent } from '@newrelic/browser-agent/loaders/browser-agent';
|
||||
import { Logging } from '@newrelic/browser-agent/features/logging';
|
||||
|
||||
import {
|
||||
initializeAnalyticsEvents,
|
||||
initializeChatwootEvents,
|
||||
@@ -47,6 +50,19 @@ app.use(i18n);
|
||||
app.use(store);
|
||||
app.use(router);
|
||||
|
||||
window.startNewRelic = options => {
|
||||
return new BrowserAgent({
|
||||
...options,
|
||||
features: [Logging],
|
||||
});
|
||||
};
|
||||
|
||||
window.logrelic = (message, options = {}) => {
|
||||
if (window.newrelic) {
|
||||
window.newrelic.log(message, { level: 'debug' }, options);
|
||||
}
|
||||
};
|
||||
|
||||
// [VITE] Disabled this, need to renable later
|
||||
if (window.errorLoggingConfig) {
|
||||
Sentry.init({
|
||||
|
||||
Reference in New Issue
Block a user