working on proxy service. getting closer

This commit is contained in:
Bojan Kucera 2025-06-08 07:36:07 -04:00
parent 6380165a94
commit afc1843fdb
5 changed files with 91 additions and 892 deletions

View file

@ -200,9 +200,10 @@ export class Logger {
* Create child logger with additional context
*/
child(context: LogContext): Logger {
const childLogger = new Logger((this.pino.bindings() as any).service, { ...this.context, ...context });
// Use the pino child logger to properly propagate context
childLogger.pino = this.pino.child(context);
// Create child logger that shares the same pino instance with additional context
const childLogger = Object.create(Logger.prototype);
childLogger.context = { ...this.context, ...context };
childLogger.pino = this.pino.child(context); // Let pino handle level inheritance naturally
return childLogger;
}
}