@@ -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 */
7267export 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