Add Sentry for Backend (#1403)
* - added sentry * - renamed env var * - logger driver * - add breadcrumb and category * - fix driver
This commit is contained in:
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
export enum LoggerType {
|
||||
Console = 'console',
|
||||
Sentry = 'sentry',
|
||||
}
|
||||
Reference in New Issue
Block a user