working on proxy service. getting closer
This commit is contained in:
parent
6380165a94
commit
afc1843fdb
5 changed files with 91 additions and 892 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue