Blog

Posts tagged “Logging”

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
What small Node teams should log in the AI-attack era. Cover graphic for a guide to logging API requests to spot bot attacks.
Security

What small Node teams should log in the AI-attack era

Bots are now more than half of web traffic, and 27% of attacks target APIs and identity systems. You don't need a security team to see it, just the right fields on every request. Here's the minimum to capture, five patterns to watch, and when to block.

Jason Fill October 27, 2026 8 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
Fastify hooks: which one does what. Cover graphic for a guide to using Fastify onRequest, preHandler and onResponse hooks for auth and logging.
Coding

Fastify hooks for logging and auth: onRequest, preHandler and onResponse explained

Auth checks that run before the body exists, log lines missing the status code, handlers that run after a 401: most come from using the wrong Fastify hook. Here is which hook does which job in Fastify v5, with working code.

Jason Fill April 20, 2026 6 min read
Credential stuffing detection in your logs. Cover graphic for a guide to detecting credential stuffing on Node API login routes.
Security

Credential stuffing detection for Node APIs: spotting it in your login logs

Every request looks like a normal login, which is why stuffing goes unseen until a customer reports a login they did not make. Here is how to see it in your logs.

Jason Fill February 26, 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
AsyncLocalStorage request IDs on every line. Cover graphic for a guide to adding request IDs to Node.js logs with AsyncLocalStorage.
Coding

AsyncLocalStorage request IDs: follow one request through a Node.js API

A customer says checkout failed at 2pm and your logs are fifty requests interleaved. Add request IDs with AsyncLocalStorage in Express or Fastify in an afternoon, and every log line, response and downstream call carries the same ID.

Jason Fill November 24, 2025 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