Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Logging Structured?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-logging-structured)
---
description: Emit structured JSON logs with correlation IDs, bounded cardinality, strict PII redaction, and safe log levels
profile: standard
tags: observability, logging, backend, security
---
# Structured logging
Use when instrumenting services, background workers, or CLI tools with application logs.
## Format and context
- Log single-line structured JSON to stdout/stderr with consistent field names (`timestamp`, `level`, `service`, `event`, `requestId`, `traceId`, `durationMs`).
- Prefer one wide canonical log event per request/job containing key metadata over dozens of scattered `info` lines inside loops.
- Propagate request and trace IDs across async boundaries and queue messages automatically via request context.
## Safety and cost
- Redact tokens, passwords, session cookies, credit cards, and raw request bodies before serialization — define explicit field allow-lists on objects.
- Keep metrics/labels out of high-cardinality log fields that break search indexes, and drop verbose `debug` payloads in production.
- Reserve `error` for actionable failures needing investigation; log expected 4xx client errors as `warn` or `info`.
## Verify
Grep test log output for JSON validity, correlation ID propagation across failures, and zero leaked secrets or tokens.