Skip to content
Back to skills

Logging Structured

ASecurity

Emit structured JSON logs with correlation IDs, bounded cardinality, strict PII redaction, and safe log levels

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agents

Works with

  • cli

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill logging-structured --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Logging Structured?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Logging Structured
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-logging-structured-anvil/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-logging-structured-anvil)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: logging-structured
description: Emit structured JSON logs with correlation IDs, bounded cardinality, strict PII redaction, and safe log levels
---

<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->

# 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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.