Skip to content

Masked Logger

Open in ChatGPTOpen in Claude

The masked logger is structured logging with a safety net: it scrubs secret-shaped values before anything is written, so a stray token in a log statement doesn’t become a plaintext leak in CloudWatch.

  • Emits structured (JSON) log lines suitable for CloudWatch Logs Insights.
  • Masks values that look like secrets before serialisation.
  • Respects a per-stage log level — the framework defaults handlers to DEBUG in dev and INFO in prod.

Pair it with serializeError(e) (safe structured error logging that never leaks a full stack to the response) and statusCodeFor(e) (maps an AtfError or generic error to an HTTP status). Both are exported from the package.

© 2026 Axis Tech. Powered by axis-tech.co.