Add Sentry for Backend (#1403)

* - added sentry

* - renamed env var

* - logger driver

* - add breadcrumb and category

* - fix driver
This commit is contained in:
brendanlaschke
2023-09-11 22:22:30 +03:00
committed by GitHub
parent 110d5eaa9d
commit 35bcef5090
15 changed files with 356 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import { ConfigService } from '@nestjs/config';
import { AwsRegion } from './interfaces/aws-region.interface';
import { StorageType } from './interfaces/storage.interface';
import { SupportDriver } from './interfaces/support.interface';
import { LoggerType } from './interfaces/logger.interface';
@Injectable()
export class EnvironmentService {
@ -120,4 +121,14 @@ export class EnvironmentService {
getSupportFrontHMACKey(): string | undefined {
return this.configService.get<string>('SUPPORT_FRONT_HMAC_KEY');
}
getSentryDSN(): string | undefined {
return this.configService.get<string>('SENTRY_DSN');
}
getLoggerDriver(): string | undefined {
return (
this.configService.get<string>('LOGGER_DRIVER') ?? LoggerType.Console
);
}
}

View File

@ -0,0 +1,4 @@
export enum LoggerType {
Console = 'console',
Sentry = 'sentry',
}