pino-http-print is a specialized utility for formatting and printing HTTP request and response logs generated by Pino-compatible HTTP loggers (such as pino-http, express-pino-logger, restify-pino-logger, or koa-pino-logger) into a concise, human-readable, `curl`-like output. It functions primarily as a Pino transport, transforming raw JSON log lines into an easily digestible format suitable for console debugging or integration with other output streams. The current stable version is v4.0.0. As part of the pinojs ecosystem, releases typically align with broader Pino updates, ensuring compatibility with current Node.js versions and core Pino features. Its key differentiation lies in its dedicated focus on structuring HTTP log data for rapid analysis, while also capable of leveraging `pino-pretty` to format general application logs when the `all` option is enabled, providing a cohesive debugging experience.
npm install pino-http-printVerified import paths — ran on the pinned version, not inferred.
Demonstrates `pino-http-print` configured as a Pino transport. It logs both HTTP requests (via `pino-http`) and general application messages from a simple Node.js HTTP server, showcasing its formatting capabilities for debugging.
Upgrade your Node.js environment to version 14 or higher. Node.js 18+ is explicitly supported and recommended for v4.x.
Always nest `pino-pretty` options under `prettyOptions`, for example: `{ all: true, prettyOptions: { ignore: 'pid,hostname' } }`.To write to a file, provide a writeable stream such as `destination: fs.createWriteStream('./http.log')` or a numeric file descriptor if applicable.Install the package using npm: `npm install pino-http-print` for local use, or `npm install -g pino-http-print` if planning to use it via the CLI as a legacy Pino transport.
Ensure you are creating your logger by passing the transport *configuration object* to `pino()`: `const transport = pino.transport({ target: 'pino-http-print', ... }); const logger = pino(transport);`