feat: log to new relic

This commit is contained in:
Shivam Mishra
2025-03-13 11:06:39 +05:30
parent 523291f5c3
commit 7ac40c8801
3 changed files with 37 additions and 0 deletions
+16
View File
@@ -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({