morgan
Battle-tested HTTP request logger middleware for Node.js and Express.
Repository Health
Technical Analysis
Morgan is an HTTP request logger middleware for Node.js, maintained under the expressjs GitHub organization and used with both Express and plain Node HTTP servers. It logs incoming requests using predefined formats (combined, common, dev, short, tiny) or fully custom format strings built from named tokens.
Morgan supports custom tokens, conditional/skip logic for filtering which requests get logged, and configurable output streams, making it a lightweight, dependency-light choice for request-level observability in Node.js applications.
What You Get
- Predefined log formats (combined, common, dev, short, tiny) matching common web server log conventions
- Custom format strings built from named tokens (:method, :url, :status, :response-time, etc.)
- Support for registering custom tokens to log application-specific request/response data
- Configurable skip functions to conditionally omit logging specific requests
- Pluggable output streams for directing logs to files, external services, or stdout
Common Use Cases
- Logging every incoming HTTP request/response in an Express application for debugging
- Producing Apache-style combined/common access logs for production Node.js servers
- Filtering logs to only capture errors or slow requests via custom skip functions
- Piping request logs into a file or external log aggregator via a custom stream
Under The Hood
Architecture - Morgan is implemented as a single middleware factory function (index.js) that wraps on-finished to hook into the response lifecycle, on-headers to capture response timing before headers are sent, and a token registry (morgan.token()) that resolves format placeholders like :method or :status at log time. Tech Stack - Pure JavaScript with minimal runtime dependencies: basic-auth for the :remote-user token, debug for internal debug logging, depd for deprecation warnings, and on-finished/on-headers for response lifecycle hooks; no build step or TypeScript, published as CommonJS. Code Quality - The project has a single but extensive test suite (test/morgan.js, ~1,800 lines) covering all predefined formats, custom tokens, skip functions, and streaming behavior; linting is enforced via ESLint with the standard config, and coverage is tracked via Coveralls. API Design - The API is a single default export (morgan(format, options)) used directly as Express/Connect middleware, with an extremely low barrier to entry — a one-line app.use(morgan('combined')) covers the common case, while morgan.token() provides an escape hatch for custom fields.
Used by 18 apps in this directory
Magic
AI Agents · Automation · Low Code Platforms
Magic is an enterprise-grade open-source AI agent platform combining a generalist AI agent, workflow engine, IM, and collaborative office system for running an AI-powered digital workforce.
medusa
Ecommerce
The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.
NodeBB
Community
Modern Node.js forum software with real-time WebSockets, multi-database support, and a plugin ecosystem — the community platform built for the open web and the Fediverse.
PeerTube
Social Media
A federated, ActivityPub-based video hosting platform built by Framasoft — self-hostable instances interconnect into a network with no vendor lock-in, P2P-assisted streaming, and no ads.
Plasmic
CMS · Design Tools · Low Code Platforms
The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.
Pyroscope
Developer Tools · Devops · Monitoring
An open-source, horizontally scalable continuous profiling platform that pinpoints CPU, memory, and I/O bottlenecks down to the exact line of code, built by Grafana Labs alongside Loki, Tempo, and Mimir.
Tianji
Analytics · Monitoring
Replace Google Analytics, UptimeKuma, and Prometheus with one self-hosted platform that tracks websites, monitors uptime, and reports server health.
Trigger.dev
AI Development · Automation · Developer Tools
Build and deploy fully-managed AI agents and background jobs in TypeScript — with no timeouts, durable retries, real-time observability, and elastic scaling built in.
Worklenz
Collaboration · Product Management · Project Management
All-in-one open source project management for teams who want full control — plan projects, track tasks, manage resources, and monitor finances without the SaaS lock-in.