Blog

Logging

Structured logging for Node.js APIs: Pino setup, log levels, request IDs, trace context, outbound calls, redaction and how long to keep it all.

Fastify logging guide header: 'Get more from Fastify's built-in pino logger' beside an illustrative JSON log line with reqId, route /orders/:id, authorization [redacted], statusCode 200
Logging

Fastify logging: getting the most from the built-in pino logger

Fastify logs every request out of the box, but the default skips routes, user agents and bodies, and Fastify 4 trusts client request ids. A tested production config for Fastify 4 and 5.

Jason Fill November 13, 2026 11 min read
Header: 'Request logs that include the 403s and 404s.' beside two illustrative log panels: a NestJS logging interceptor that logged 1 of 4 requests, and nestjs-pino middleware that logged all 4 (200, guard 403, unmatched 404, 500).
Logging

NestJS logging: the built-in Logger, nestjs-pino and request logs that include rejected requests

Nest's built-in Logger prints no request logs, and logging interceptors never see a guard's 403 or an unmatched 404. This guide sets up nestjs-pino with request IDs, redaction and route patterns, tested on NestJS 11 and 12.

Jason Fill November 13, 2026 12 min read
Express logging in production: three JSON log lines from pino-http with request ID, route pattern /v1/orders/:orderId, a redacted password on a 401 and a 500 on the refund route (illustrative)
Logging

Express logging in production: pino-http vs morgan, request bodies and redaction

morgan, pino-http or winston? A production Express logging setup on Express 5: one JSON line per request with request ID, route and user, bodies for failed requests only, pino redaction, and errors on the same line.

Jason Fill November 13, 2026 11 min read
Node.js API logging: 'What to log for every API request' beside illustrative JSON log lines with route /orders/:id, status 200, responseTime, reqId and userId, a 401 on /login with the password redacted, and an outbound call sharing the same request ID.
Logging

Node.js API logging: what to log for every request, and how

Most Node.js API logs can't answer "what happened to this customer's request?" This guide covers the six fields every request line needs, safe body capture that keeps streaming intact, redaction, outbound calls, and the queries to run, with code tested on Node 22 and 24.

Jason Fill November 13, 2026 19 min read
W3C trace context: one ID, every hop. Cover graphic for a guide to propagating traceparent across Node.js services to correlate requests.
Logging

W3C Trace Context in Node.js: correlating requests across services with traceparent

Three services, three log streams, one failed order, and nothing to join them on. W3C Trace Context gives every hop the same trace ID. Here is how to propagate traceparent in Node with OpenTelemetry, or in 30 lines without it.

Jason Fill October 27, 2026 6 min read
API log retention without the surprise bill. Cover graphic for a guide to request log retention, sampling and cost for small API teams.
Logging

API log retention and cost: how much request logging a small team needs

Either the logging bill surprises you or the logs are gone when a customer asks about last month. Here is a retention policy a small team can set up in an afternoon.

Jason Fill July 8, 2026 6 min read
Node.js log levels that mean something. Cover graphic for a guide to a log level policy for small Node.js teams.
Logging

Node.js log levels that mean something: a logging policy for small teams

At 3am your error log is full of scanner 404s and the real database timeout is buried. Here is a Node.js log levels policy a small team can paste into its repo, plus the code that enforces it.

Jason Fill April 29, 2026 6 min read
Log outbound HTTP requests per host. Cover graphic for a guide to logging fetch and axios calls in Node.js with diagnostics_channel.
Logging

How to log outbound HTTP requests in Node.js

Your API threw 502s because a provider was timing out, and your logs said nothing. Log outbound HTTP requests from fetch and axios with diagnostics_channel in an afternoon, then read error rate and p95 per host.

Jason Fill February 18, 2026 6 min read
Redact sensitive data in logs. Cover graphic for a guide to keeping secrets and personal data out of Node.js API logs.
Logging

How to redact sensitive data in logs for Node.js APIs

Found a bearer token in your logs? Here's how to keep secrets and personal data out of Node API logs in an afternoon: Pino redaction, URL and error scrubbing, body allowlists and a test that catches leaks.

Jason Fill January 5, 2026 6 min read
Pino logging you can actually query. Cover graphic for a guide to structured Pino logging in Express and Fastify.
Logging

Pino logging in Node.js: a practical structured logging setup for Express and Fastify

A customer says invoices failed yesterday and your logs are a wall of console.log. Set up Pino logging for Express or Fastify in an afternoon: JSON lines, request IDs, levels by status, redaction and a team checklist.

Jason Fill November 4, 2025 6 min read