feat: logs
This commit is contained in:
parent
41c3bbf0bf
commit
f9ad6be60a
|
|
@ -9,14 +9,10 @@ export const SentryComponent: FC<{ children: ReactNode }> = ({ children }) => {
|
|||
|
||||
useEffect(() => {
|
||||
if (!dsn) {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
initializeSentryClient(dsn);
|
||||
} catch (error) {
|
||||
console.error('[Sentry] Configuration error:', error);
|
||||
}
|
||||
initializeSentryClient(dsn);
|
||||
}, [dsn]);
|
||||
|
||||
// Always render children - don't block the app
|
||||
|
|
|
|||
|
|
@ -24,9 +24,10 @@ export const initializeSentry = (appName: string) => {
|
|||
integrations: [
|
||||
// Add our Profiling integration
|
||||
nodeProfilingIntegration(),
|
||||
Sentry.consoleLoggingIntegration({ levels: ['log', 'error', 'warn'] }),
|
||||
],
|
||||
tracesSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.3,
|
||||
profilesSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.1,
|
||||
enableLogs: true,
|
||||
});
|
||||
} catch (err) {}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -5,24 +5,26 @@ export const initializeSentryBasic = (dsn: string, extension: any) => {
|
|||
return;
|
||||
}
|
||||
|
||||
Sentry.init({
|
||||
initialScope: {
|
||||
tags: {
|
||||
service: 'frontend',
|
||||
component: 'nextjs',
|
||||
replaysEnabled: 'true',
|
||||
},
|
||||
contexts: {
|
||||
app: {
|
||||
name: 'Postiz Frontend',
|
||||
version: process.env.NEXT_PUBLIC_APP_VERSION || '0.0.0',
|
||||
try {
|
||||
Sentry.init({
|
||||
initialScope: {
|
||||
tags: {
|
||||
service: 'frontend',
|
||||
component: 'nextjs',
|
||||
replaysEnabled: 'true',
|
||||
},
|
||||
contexts: {
|
||||
app: {
|
||||
name: 'Postiz Frontend',
|
||||
version: process.env.NEXT_PUBLIC_APP_VERSION || '0.0.0',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
dsn,
|
||||
sendDefaultPii: true,
|
||||
...extension,
|
||||
debug: process.env.NODE_ENV === 'development',
|
||||
tracesSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.3,
|
||||
});
|
||||
dsn,
|
||||
sendDefaultPii: true,
|
||||
...extension,
|
||||
debug: process.env.NODE_ENV === 'development',
|
||||
tracesSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.3,
|
||||
});
|
||||
} catch (err) {}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue