Logging for any language: what never to log, log injection, structured output, trace IDs, OpenTelemetry attributes. Load before any edit to logging code or config, however small.
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 Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ku5ic-logging-patterns)
---
name: logging-patterns
description: Logging for any language: what never to log, log injection, structured output, trace IDs, OpenTelemetry attributes. Load before any edit to logging code or config, however small.
---
# Logging patterns
Default assumption: the stable OpenTelemetry Logs data model and semantic conventions 1.45, per the OpenTelemetry specification, with the OWASP Logging Cheat Sheet for what to log and what never to log.
A semantic-conventions row applies when the conventions version the project's OpenTelemetry instrumentation emits is at least the row's version, and a specification row when its OpenTelemetry SDK implements that specification version. The Python standard library `logging` and structlog entries are in python-patterns.
## Reference files
Loading this skill isn't enough. Before your next edit, read the file of every row that matches it. The rules live in those files, and this one only points at them.
| Before | Read |
| --------------------------------------------------------------------------- | -------------------------------------------------------- |
| Setting OpenTelemetry log attributes, or raising the semconv or SDK version | [reference/upgrades.md](reference/upgrades.md) |
| Writing, changing, or reviewing logging code or log configuration | [reference/anti-patterns.md](reference/anti-patterns.md) |
| Choosing what to log, its level, its format, or where it goes | [reference/practices.md](reference/practices.md) |
| Scanning code for secrets in logs or log injection | [reference/tooling.md](reference/tooling.md) |