expressjs/morgan

HTTP request logger middleware for node.js

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 37 minutes ago
Added to GitGenius on September 8th, 2026
Created on February 8th, 2014
Open Issues & Pull Requests: 19 (+0)
GitHub issues: Enabled
Number of forks: 566
Total Stargazers: 8,201 (+0)
Total Subscribers: 85 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 18.0 days
Mean response time: 136.8 days
90th percentile: 519.7 days
Tracked items: 14

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 3
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 2,671 days
Stale 30+ days: 2
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (3)
  • enhancement (2)
  • awaiting more info (1)
  • help wanted (1)
  • investigate (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Morgan is an HTTP request logger middleware for Node.js that integrates with Express applications to record incoming requests and outgoing responses.

Morgan solves the problem of tracking HTTP traffic through your application by providing a middleware layer that logs request and response details. It works by intercepting requests as they flow through Express, capturing information like method, URL, status code, and response time, then writing formatted log entries to a specified output stream. The tool offers both predefined log formats modeled after Apache standards and the ability to define custom formats through either token-based strings or custom functions that receive the full request and response objects.

Developers should choose Morgan if they need straightforward HTTP request logging in an Express application without additional dependencies or complexity. It suits projects ranging from development environments where colored, concise output aids debugging to production systems requiring structured logging. The tool provides several predefined formats including combined and common Apache formats, a development format with color-coded status indicators, and minimal formats for compact output. Custom token definitions allow extending the logger with application-specific data. The immediate option enables logging even if the server crashes, though response data becomes unavailable. The skip function lets you conditionally suppress logging for certain requests, and the stream option allows directing output to files, log aggregation services, or structured logging systems that accept objects.

The project maintains steady engagement with regular issue responses and pull request reviews. Development activity shows consistent attention to bug reports and feature requests from the community. The maintainers demonstrate responsiveness to compatibility concerns and edge cases raised by users. Updates are released to address reported issues and maintain compatibility with evolving Node.js and Express versions.