DEV Community

Sai Sandeep Vaddi
Sai Sandeep Vaddi

Posted on

What do you use for structured logging in NodeJS?

I use Winston + Morgan with daily rotating log file.

But, the searching, filtering is kind of hard to do. I know there are online SaaS loggers like loggly. I'm searching for some good & easy to setup practices about backend logging.

How do you setup your logging in NodeJS apps or any backend?

Top comments (2)

Collapse
 
loujaybee profile image
Lou (πŸš€ Open Up The Cloud ☁️)

In terms of "patterns"...

I'd implore you strongly to look into honeycomb: honeycomb.io/ When I started reading about their philosophy of log events, my mind exploded. I tried it and loved it...I did a bit of a write up of it here: thedevcoach.co.uk/phat-event-logging/

In terms of tools...

Log saas tools are a pain in the ass. If you have an AWS account, you could ship them to cloudwatch and use that. Personally I'm a big fan of cloudwatch insights, you can do some pretty neat stuff with it. And if you set up your log rentions nicely, you'll hardly pay anything.

Collapse
 
saisandeepvaddi profile image
Sai Sandeep Vaddi

Thanks for the details. I'll check it out.