Closed dlcoffee closed 1 year ago
is there a reason why i would choose pino.multistream() over multiple transport targets?
transports works off the main thread. This has some consequences - ideally better performance. However there might be edge cases where you need to be in-thread. Generically, use transports.
do the examples in the documentation need to be updated to use more pino.destination() over fs.createWriteStream()
Possibly, would you like to send a PR?
(a bit related to 1) is the performance warning around pino.multistream still relevant since it is async by default?
Writing to multiple destinations adds overhead and latency. It's simply more work to do for your process. Doing it inside the main thread will increase the latency of your HTTP responses.
hmm, okay maybe it is my misunderstanding that multistream being asynchronous is not the same as it working off the main thread. it's still on the main thread, but it only buffers the messages and writes them in chunks.
Lmao obviously this is the use case for virtually anyone in a dev environment and yet there is virtually no documentation on how to do it, ChatGPT can't do it, there's no examples on Stackoverflow, amazing
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
i'm a new pino user and i'm trying to figure out what the correct pino apis to use are. my use case is that i'd like to be able to to log to the console as well as a file. it seems like i can do it two ways:
using multiple
transport
targetsusing
multistream
const logger = pino( { level: 'trace', }, pino.multistream(streams) )