Skip to content

Commit ad8d112

Browse files
committed
Revert "Send all log levels to cloud observability regardless of terminal log level (#942)"
This reverts commit 0ff2d1a.
1 parent 79a6fac commit ad8d112

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

agents/src/log.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ class OtelDestination extends Writable {
6262
* Enable OTEL logging by reconfiguring the logger with multistream.
6363
* Uses a custom destination that receives full JSON logs (with msg, level, time).
6464
*
65-
* The base logger level is set to 'debug' so all logs are generated,
66-
* while each stream filters to its own level:
67-
* - Terminal: user-specified level (default: 'info')
68-
* - OTEL/Cloud: always 'debug' to capture all logs for observability
69-
*
7065
* @internal
7166
*/
7267
export const enableOtelLogging = () => {
@@ -78,12 +73,11 @@ export const enableOtelLogging = () => {
7873

7974
const { pretty, level } = loggerOptions;
8075

81-
const terminalLevel = level || 'info';
76+
const logLevel = level || 'info';
8277
const streams: { stream: DestinationStream; level: string }[] = [
83-
{ stream: pretty ? pinoPretty({ colorize: true }) : process.stdout, level: terminalLevel },
78+
{ stream: pretty ? pinoPretty({ colorize: true }) : process.stdout, level: logLevel },
8479
{ stream: new OtelDestination(), level: 'debug' },
8580
];
8681

87-
// Base level must be 'debug' to generate all logs; each stream filters independently
88-
logger = pino({ level: 'debug' }, multistream(streams));
82+
logger = pino({ level: logLevel }, multistream(streams));
8983
};

0 commit comments

Comments
 (0)