Morgan

screenshot of Morgan
express

HTTP request logger middleware for node.js

Overview

Morgan is a HTTP request logger middleware for node.js, named after the show Dexter. It is used to log request information in a Node.js application. Users can create a new morgan logger middleware function using predefined formats, custom format functions, and various options. The module is available through npm registry and can be installed using npm install command.

Features

  • Request Logging: Log HTTP requests and their responses.
  • Predefined Formats: Use standard Apache log outputs like 'combined', 'common', 'dev', 'short', and 'tiny'.
  • Custom Format Function: Create custom format functions for logging.
  • Immediate Logging: Write log lines on request instead of waiting for response.
  • Skip Logging Function: Option to skip logging based on specific conditions.
  • Output Stream: Define the output stream for writing log lines.

Summary

Morgan is a versatile middleware for logging HTTP requests and responses in Node.js applications. With various predefined formats, custom format functions, and options like immediate logging and skip functions, it provides flexibility in logging data. By following the installation guide, developers can easily integrate Morgan into their projects to track and analyze incoming HTTP requests.

express
Express

Express.js is a simple Node.js framework for single, multi-page, and hybrid web applications.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.