Alright, folks, gather ’round! Today, I’m diving into a little experiment I did comparing two popular * logging libraries: Serrano and Morgan. I wanted to see which one fit better into my workflow, and, well, let’s just say it was a bit of a journey.
Setting the Stage
First things first, I needed a project to test these bad boys on. I decided to use a simple * API I’ve been tinkering with. Nothing fancy, just a few endpoints to get, post, and delete some data. The goal was to see how each logger handled the basic stuff – logging requests, responses, and maybe a few custom messages.

Round 1: Morgan
I started with Morgan because, honestly, it’s the one I’ve used the most. It’s super easy to get going. I installed it with:
npm install morgan
Then, in my main app file, I did this:
const morgan = require('morgan');
*(morgan('dev'));
Boom! Instant request logging in my console. The 'dev'
format is pretty concise, showing the method, URL, status code, response time, and content length. It’s great for development, but I wanted something a little more detailed for production.

I played around with some other formats like 'combined'
and 'tiny'
, but I still felt like I was missing something. I wanted more control over what was being logged and how it was formatted.
Round 2: Serrano
I then came across Serrano from a random article. The promise of being more detailed than Morgan intrigued me.
I added Serrano to my project with:
npm install serrano
And used it like this:

const serrano = require('serrano');
When I ran my test requests, the difference was pretty obvious. The log messages were much more verbose. So much more, actually, that the console started to become a little difficult to read! However, the level of detail was, at times, valuable. I could see everything – request headers, body (if any), response headers, response time. It was a lot of info, which is good in case you need to look into it, but not great for quick, at-a-glance logging.
Customization Time!
Both libraries let you customize things, of course. With Morgan, you can define your own format strings or use tokens to pick and choose what you want to log. With Serrano, things are pretty verbose, so you get the whole thing. I tried to implement custom logging in both, for example, to always log any errors. It was about the same level of effort for both, with only a few changes to the setup code.
The Verdict?
So, after playing around with both, which one came out on top? Honestly, it depends. It really does!
- For quick and dirty development logging: Morgan’s
'dev'
format is hard to beat. It’s simple, clean, and gives you the essentials. - For super detailed, “I need to see everything” logging: Serrano is your friend. Just be prepared for a firehose of information.
For my little project, I ended up sticking with Morgan. I liked the balance of simplicity and information. But, I’m definitely keeping Serrano in my back pocket for those times when I need to dig deep into what’s going on with my requests and responses.

The best part? Trying both out taught me a lot more about logging in general. So, don’t be afraid to experiment and find what works best for you!