ext-http-request-logger v0.1.0
subsystem
capsule://quake0day/[email protected]
Provides a flexible HTTP request logging middleware for Node.js applications, supporting various predefined and custom logging formats, and a mechanism for defining custom tokens to extract request/response data. This capsule encapsulates the core functionality of the `morgan` library.
Owns
- The core `morgan` middleware logic.
- Predefined logging formats (e.g., 'combined', 'dev').
- Mechanism for defining custom tokens.
- Project metadata, dependencies, and official documentation.
Does not own
- Development-specific configurations (e.g., linting, testing setup).
- Continuous integration workflows.
AI orientation
This capsule contains the core logic for the `morgan` HTTP request logger. It exposes the main `morgan` middleware function, along with `compile`, `format`, and `token` utilities for customizing logging behavior. An agent working on this should focus on adding new logging formats, custom tokens, improving performance, or fixing bugs related to log generation and middleware integration. Ensure changes maintain compatibility with existing Express.js applications.
Avoid
- Modifying the `package.json` `devDependencies` or `scripts` directly, as these are managed by the `ext-http-request-logger-dev` capsule.
- Introducing project-specific configurations that are not generalizable to an HTTP logger.
Provides
library:morgan— A Node.js HTTP request logger middleware function and related utilities (e.g., `morgan.compile`, `morgan.format`, `morgan.token`).
Requires
library:basic-auth— Utility for parsing basic HTTP authentication headers.library:debug— Tiny Node.js debugging utility.library:depd— Deprecate a function or module.library:on-finished— Execute a callback when a HTTP request/response finishes, closes, or errors.library:on-headers— Execute a listener when a response is about to write headers.
Invariants (must always hold)
- The `morgan` function must always return a valid Express-style middleware.
- Predefined formats must produce consistent log outputs.
- Custom tokens must be correctly registered and resolvable within format strings.
Source files (5)
Click any file to view its content; the path on the right shows where the file lands when this capsule is installed.
src/index.js→src/index.jssrc/package.json→package.jsonsrc/README.md→README.mdsrc/HISTORY.md→HISTORY.mdsrc/LICENSE→LICENSE
Plus capsule.yaml and
install.json.