pinojs / pino

🌲 super fast, all natural json logger
http://getpino.io
MIT License
13.62k stars 853 forks source link

pino transport - is it worth using a transport in another process for writing to stdout? #2000

Open RichardWright opened 2 days ago

RichardWright commented 2 days ago

To stop our thread being blocked, is it possible to get a worker thread eg a transport to handle logging to stdout? Does this transport used shared memory to get around serialisation costs?

Thanks!

mcollina commented 2 days ago

To stop our thread being blocked, is it possible to get a worker thread eg a transport to handle logging to stdout?

It's supported, but not something I would recommend unless you have some specific needs to fix.

Does this transport used shared memory to get around serialisation costs?

It uses some shared memory but there will be some serialisation costs involved.

RichardWright commented 1 day ago

It's supported, but not something I would recommend unless you have some specific needs to fix. We have long running stateful processes which can get less reactive as gc picks up. Anything we can offload is therefore good for us

It uses some shared memory but there will be some serialisation costs involved.

If the objects stay in memory, what are the serialisation costs?

It uses some shared memory but there will be some serialisation costs involved.

_**