diff --git a/CommonServer/Utils/Logger.ts b/CommonServer/Utils/Logger.ts index fe970e343a..377c254f81 100644 --- a/CommonServer/Utils/Logger.ts +++ b/CommonServer/Utils/Logger.ts @@ -21,6 +21,9 @@ export default class logger { LogLevel === ConfigLogLevel.DEBUG || LogLevel === ConfigLogLevel.INFO ) { + // eslint-disable-next-line no-console + console.info(message); + this.emit({ body: message, severityNumber: SeverityNumber.INFO, @@ -35,6 +38,9 @@ export default class logger { LogLevel === ConfigLogLevel.WARN || LogLevel === ConfigLogLevel.ERROR ) { + // eslint-disable-next-line no-console + console.error(message); + this.emit({ body: message, severityNumber: SeverityNumber.ERROR, @@ -48,6 +54,9 @@ export default class logger { LogLevel === ConfigLogLevel.INFO || LogLevel === ConfigLogLevel.WARN ) { + // eslint-disable-next-line no-console + console.warn(message); + this.emit({ body: message, severityNumber: SeverityNumber.WARN, @@ -57,6 +66,9 @@ export default class logger { public static debug(message: LogBody): void { if (LogLevel === ConfigLogLevel.DEBUG) { + // eslint-disable-next-line no-console + console.debug(message); + this.emit({ body: message, severityNumber: SeverityNumber.DEBUG, diff --git a/CommonServer/Utils/Telemetry.ts b/CommonServer/Utils/Telemetry.ts index 366b472cc6..871195ff80 100644 --- a/CommonServer/Utils/Telemetry.ts +++ b/CommonServer/Utils/Telemetry.ts @@ -8,9 +8,7 @@ import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentation import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http'; import { BatchLogRecordProcessor, - ConsoleLogRecordExporter, LoggerProvider, - SimpleLogRecordProcessor, } from '@opentelemetry/sdk-logs'; import URL from 'Common/Types/API/URL'; import { SpanExporter } from '@opentelemetry/sdk-trace-node'; @@ -135,10 +133,6 @@ export default class Telemetry { ); } - loggerProvider.addLogRecordProcessor( - new SimpleLogRecordProcessor(new ConsoleLogRecordExporter()) - ); - logs.setGlobalLoggerProvider(loggerProvider); this.logger = logs.getLogger('default');