Bunyan or winston ? how do they differ to each other ?

16 views
Skip to first unread message

grin hilarious

unread,
Oct 30, 2017, 11:17:54 AM10/30/17
to nodejs
How does these two libraries differ to each other ! I have studied all the documentation, forums and almost covered all the sites . I wanted a practical info of those two libraries . How does each library stands unique to the other . let me know your opinions and experience.!

Jaret Flores

unread,
Oct 31, 2017, 4:09:16 PM10/31/17
to nodejs
I don't know too much about Winston, but I have used bunyan for a while now.  

What's nice about bunyan is that each log command will write to a single line in the log file.  Whenever you need to do some investigation by search for key words, you can easily grep the logs and pipe the output into bunyan for pretty output: 

cat app.log | grep <USER_ID> | bunyan

The downside of this is that the logs are not very readable unless you use bunyan.  In general this may not be an issue, but for large log files it can cause a lot of slow down since bunyan needs to parse all the lines.  So if you open the file and then search for a word, bunyan will need to parse everything from the top of the file to the first occurrence of the keyword.  If the files are really big and/or your machines can get into low memory situations, I've even had an issue where I couldn't open a large log file with bunyan probably because it requires more memory than `less` alone.

If I were starting a new project I would choose a logger based on the following:  am I using a logging aggregation service like splunk?  If so, choose a logger that works well with that service.  If not, I would probably just choose a logger that didn't require a command line tool for readability.  It's easier if you can simply use grep+less (grep has -A -B flags anyway) for browsing.

DaneiL

unread,
Oct 31, 2017, 4:56:42 PM10/31/17
to nod...@googlegroups.com
In my personal applications i am using morgan. Never needed nothing too much for this, everything i need (until now) it has implemented.
It play nice with my testing framework where i can switch off the logs.

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/08bb52ae-509f-4930-b822-62e4a76336eb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
[]'s
Reply all
Reply to author
Forward
0 new messages