Closed jeffrson closed 2 years ago
With debug package we had logs with names like "app:sub1", "app:another" a.s.o.
How can I achieve this with pino/pino-pretty?
At first I tried
logger.child({name: "sub1"})
which created log entries with two "name" fields (one for main, one for child). Then I used
logger.child({category: "sub1"})
which is formatted by pino-pretty in a second line.
What is the recommended approach?
Looks like overwriting "name" works with pino-pretty as expected:
logger.child({name: "main:sub1"})
However, there seems to be a bug in pino: https://github.com/pinojs/pino/issues/1420
With debug package we had logs with names like "app:sub1", "app:another" a.s.o.
How can I achieve this with pino/pino-pretty?
At first I tried
which created log entries with two "name" fields (one for main, one for child). Then I used
which is formatted by pino-pretty in a second line.
What is the recommended approach?