Okay, so I’ve been messing around with these two JavaScript libraries, Serrano and Morgan, for logging HTTP requests in my * projects. It’s been a bit of a journey, so I figured I’d share my experience in case anyone else is trying to decide between the two.
![Amanda Serrano vs Sarah Mahfoud: Fight Preview (Simple Terms)](https://www.darkscape.net/wp-content/uploads/2025/02/ecd7454e2bfee90a3c42949f09919737.jpeg)
Getting Started
First, I needed to get these things installed. I fired up my terminal and used npm, which is pretty much the standard way to do things in the * world:
npm install serrano morgan
Simple enough, right? Both libraries were installed without a hitch.
Experiment Time
Serrano first, setting it up in project:
- Import serrano:
const serrano = require('serrano');
- Enable all logs:
- Set up a quick route just sending back ‘hello world’.
- Make a request, then saw the logs show up.
I can see it logged that request, method, url, response time, the status, even some other stuff about the request itself.
Then Morgan, setting it up in project:
- Import morgan:
const morgan = require('morgan');
- Use morgan:
*(morgan('combined'))
- Use app and port:
*(3000, () => *("running"))
- Make a request, then saw the logs show up.
So Morgan definitely gave me a lot of info in that log. I saw the method (GET), the URL, the status (200, so it worked!), how long it took (in milliseconds), and even the user-agent string, telling what browser made the request.
Both loggers printed something to the console, that’s what I needed.
![Amanda Serrano vs Sarah Mahfoud: Fight Preview (Simple Terms)](https://www.darkscape.net/wp-content/uploads/2025/02/e500bef6c75e3425fee13cf5dc0ce679.jpeg)
Customizing Stuff
Serrano
I could also pick and choose what Serrano logs using enable and disable. There are other formats too, but I didn’t mess with those.
Morgan
Morgan felt more flexible, and I could use predefined format, and even define some formats for my needs, very useful.
My Final Thoughts
After playing with both, here’s the deal: they both worked. They both logged my requests. But honestly, Morgan seems more mature. It’s got more options, it’s super configurable, and it’s part of this bigger Express ecosystem, which is a plus if you’re already using Express (which I am). Serrano’s cool for quick and dirty stuff, but Morgan just felt more robust. That’s just my two cents, though. Your mileage may vary!