diff --git a/packages/opentelemetry-core/src/common/ConsoleLogger.ts b/packages/opentelemetry-core/src/common/ConsoleLogger.ts index d1a0018340e..d0ee72eaffb 100644 --- a/packages/opentelemetry-core/src/common/ConsoleLogger.ts +++ b/packages/opentelemetry-core/src/common/ConsoleLogger.ts @@ -19,7 +19,7 @@ import { LogLevel } from './types'; import { getEnv } from '../platform'; export class ConsoleLogger implements Logger { - constructor(level: LogLevel = getEnv().OTEL_LOG_LEVEL || LogLevel.INFO) { + constructor(level: LogLevel = getEnv().OTEL_LOG_LEVEL) { if (level >= LogLevel.DEBUG) { this.debug = (...args) => { console.debug(...args); diff --git a/packages/opentelemetry-core/src/utils/environment.ts b/packages/opentelemetry-core/src/utils/environment.ts index 86679d293d1..85ddfc70faa 100644 --- a/packages/opentelemetry-core/src/utils/environment.ts +++ b/packages/opentelemetry-core/src/utils/environment.ts @@ -37,7 +37,7 @@ const ENVIRONMENT_NUMBERS: Partial[] = [ */ export const DEFAULT_ENVIRONMENT: Required = { OTEL_NO_PATCH_MODULES: '', - OTEL_LOG_LEVEL: LogLevel.ERROR, + OTEL_LOG_LEVEL: LogLevel.INFO, OTEL_SAMPLING_PROBABILITY: 1, }; @@ -85,7 +85,7 @@ export function parseEnvironment(values: ENVIRONMENT_MAP): ENVIRONMENT { const logLevelString = value.toUpperCase() as LogLevelString logLevel = LogLevel[logLevelString]; } - environment[key] = logLevel ?? LogLevel.ERROR; + environment[key] = logLevel || DEFAULT_ENVIRONMENT[key] break; default: