diff --git a/libs/api/observability/src/lib/filters/sentry-exceptions.filter.ts b/libs/api/observability/src/lib/filters/sentry-exceptions.filter.ts index 1d2171116..6fdcbb4d0 100644 --- a/libs/api/observability/src/lib/filters/sentry-exceptions.filter.ts +++ b/libs/api/observability/src/lib/filters/sentry-exceptions.filter.ts @@ -7,11 +7,9 @@ import { KordisLogger } from '../services/kordis-logger.interface'; @Catch() export class SentryExceptionsFilter implements ExceptionFilter { - readonly logger: KordisLogger; - - constructor(_logger: Logger) { - this.logger = _logger; - } + private readonly logger: KordisLogger = new Logger( + SentryExceptionsFilter.name, + ); catch(exception: unknown): void { if (exception instanceof PresentableException) { diff --git a/libs/api/observability/src/lib/sentry-observability.module.ts b/libs/api/observability/src/lib/sentry-observability.module.ts index d0c1b2f16..84b2aae76 100644 --- a/libs/api/observability/src/lib/sentry-observability.module.ts +++ b/libs/api/observability/src/lib/sentry-observability.module.ts @@ -1,4 +1,4 @@ -import { Logger, Module, OnModuleInit } from '@nestjs/common'; +import { Module, OnModuleInit } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { APP_FILTER, APP_INTERCEPTOR, ModulesContainer } from '@nestjs/core'; import { init as initSentry } from '@sentry/node'; @@ -7,7 +7,6 @@ import { SentryExceptionsFilter } from './filters/sentry-exceptions.filter'; import { SentryOTelUserContextInterceptor } from './interceptors/sentry-otel-user-context.interceptor'; import oTelSDK from './oTelSdk'; import { KORDIS_LOGGER_SERVICE } from './services/kordis-logger-service.interface'; -import { KordisLogger } from './services/kordis-logger.interface'; import { SentryLogger } from './services/sentry-logger.service'; import { wrapProvidersWithTracingSpans } from './trace-wrapper'; @@ -30,10 +29,6 @@ import { wrapProvidersWithTracingSpans } from './trace-wrapper'; exports: [KORDIS_LOGGER_SERVICE], }) export class SentryObservabilityModule implements OnModuleInit { - private readonly logger: KordisLogger = new Logger( - SentryObservabilityModule.name, - ); - constructor( private readonly config: ConfigService, private readonly modulesContainer: ModulesContainer, @@ -49,7 +44,5 @@ export class SentryObservabilityModule implements OnModuleInit { }); wrapProvidersWithTracingSpans(this.modulesContainer); oTelSDK.start(); - - this.logger.log('Sentry initialized'); } }