Understanding Morgan - The express logging tool

Опубликовано: 29 Май 2026
на канале: Ehiane
100
2

In this tutorial, we explore Morgan, a Node.js middleware used for logging HTTP requests in Express applications.
I’ll walk you through setting up a simple Express server, installing Morgan, using different logging formats like dev, tiny, and combined, and even show how to create custom logging styles and log to a file.

This tutorial is beginner-friendly and includes a full live coding demonstration, Postman setup, and examples of real-world scenarios where Morgan is useful.

Topics Covered:
• What is Morgan?
• Why use Morgan?
• Installing and setting up Express + Morgan
• Basic and advanced usage of Morgan
• Isolating Morgan logging to specific routes
• Using Postman to test your API routes
• Customizing Morgan logs (custom tokens and formats)
• Saving logs to a file (file stream)
• Tradeoffs between different Morgan logging formats



Postman Resources:
• Download Postman: https://www.postman.com/downloads/
• Postman Documentation: https://learning.postman.com/docs/get...



Morgan Official Documentation:
• GitHub Repo: https://github.com/expressjs/morgan



Thanks for watching!
If you found this helpful, don’t forget to leave a like and consider sharing with other developers who might benefit.

#Nodejs #Express #Morgan #Postman #WebDevelopment #BackendDevelopment