Using bristol with console target in prod
Closed this issue · 3 comments
I've set up bristol for production with file
target and human
formatter. I didn't use console
target as it was said in Bristol docs to be non async and blocking. But what nodejs docs say is:
The console functions are usually asynchronous unless the destination is a file
So is this still the case and console
target should be avoided in prod? I used to use pm2 log management and now when I don't log to console it's getting pretty useless.
Hey @mostr, sorry for the late response. I recommend against console prod because of the very next line in that same doc:
Additionally, console functions are blocking when outputting to TTYs (terminals) on OS X as a workaround for the OS's very small, 1kb buffer size. This is to prevent interleaving between stdout and stderr.
Admittedly, I didn't realize that was just limited to OS X-- so it would appear safe to use! I'm working on a 2.0 release for Bristol and may include a target that writes directly to the stdout stream so that I can say it's universally safe.
Please reopen if you have any other concerns!