TomFrost / Bristol

Insanely configurable logging for Node.js
MIT License
113 stars 19 forks source link

Using bristol with console target in prod #20

Closed mostr closed 8 years ago

mostr commented 8 years ago

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.

TomFrost commented 8 years ago

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!

mostr commented 7 years ago

@TomFrost is there any release roadmap for 2.0 version?

mostr commented 7 years ago

@TomFrost ping ^. Any plans for next release with stuff mentioned above?