Morgan is a middleware for node.js that logs HTTP requests and is commonly used in Express projects. The middleware pattern is just a list of handler methods, each of which calls the next in line once it has done its work.
Node.js logging can be done in a variety of ways. To improve logging, we can use the built-in features or one of the many popular packages. Logs can be used to analyse user behaviour and the application's general health.