logging-review
Skill0 starsChanged 9 days agoMITView on GitHub
Review logging in code - missing logs at errors, external calls and security events, log noise, wrong log levels, sensitive and personal data in logs (passwords, tokens, GDPR data), string formatting instead of structured/parameterized logging, missing context like request or entity IDs, print/console.log instead of the project logger, exceptions logged without stack trace or twice, and log injection. Use when asked to check/review/audit logging, log levels, log output, observability or "what should I log", in any language.
In this repository28 other files it gives its agents.
- accessibility-auditSkill
- api-design-reviewSkill
- architecture-reviewSkill
- complexity-checkSkill
- concurrency-reviewSkill
- config-reviewSkill
- cpp-google-styleSkill
- csharp-google-styleSkill
- dead-code-finderSkill
- dependency-auditSkill
- doc-comment-auditSkill
- error-handling-reviewSkill
- full-reviewSkill
- java-google-styleSkill
- markdown-readme-google-styleSkill
- naming-reviewSkill
- owasp-security-reviewSkill
- performance-reviewSkill
- privacy-reviewSkill
- python-google-styleSkill
- regex-reviewSkill
- repo-hygieneSkill
- review-without-fixingSkill
- secrets-scanSkill
- shell-google-styleSkill
- sql-reviewSkill
- test-coverage-reviewSkill
- todo-auditSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Check the files/directories the user names, otherwise the whole repo.
- Distinctive: line 15
Check the important points for presence of logs (LG1): error handling, calls to external systems, authentication/authorization events, …
- Distinctive: line 16
Check existing log statements for LG2-LG12.
- Distinctive: line 50
Every finding has a concrete location.
- Distinctive: line 54
Do not change code. Apply fixes only when the user explicitly asks for it.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Logging review
Review only: report findings, never change logging code unless the user explicitly asks.
Scope
Check the files/directories the user names, otherwise the whole repo. Focus on production code. Skip .git/, build output, vendor/, node_modules/, .venv/, generated code; tests and dev scripts only for LG4 (sensitive data in fixtures that end up in logs).
Steps
- Find the logging setup: library (
logging, SLF4J/Logback/Log4j2,Microsoft.Extensions.Logging/Serilog/NLog,winston/pino,zap/slog,spdlog, Godotprint/push_error/push_warning, UnityDebug.Log), configuration (levels per environment, format, sinks) and conventions already used. - Check the important points for presence of logs (LG1): error handling, calls to external systems, authentication/authorization events, startup configuration, important state changes.
- Check existing log statements for LG2-LG12.
- Report (format below).
Level guide
| Level | Use for |
| ERROR | an operation failed and needs attention (someone may need to act) |
| WARN | unexpected but handled (retry succeeded, fallback used, deprecated usage) |
| INFO | important business/lifecycle events (startup, config summary, job finished) - few per request at most |
| DEBUG | details for developers (inputs, decisions, intermediate values) - off in production |
| TRACE | very fine-grained flow, loops - off by default |
Rules
- LG1 warning: missing log where it matters: caught errors that are handled silently, failed external calls, security events (login failure, access denied, permission changes), startup configuration, retries/fallbacks
- LG2 warning: log noise - logging inside tight loops, per-item INFO logs in batch jobs, the same message on every request/frame
- LG3 warning: wrong level (table above) - errors at INFO, expected conditions at ERROR, debug details at INFO
- LG4 error: sensitive data in logs: passwords, tokens, API keys, session IDs, full card numbers, private keys; personal data (GDPR: e-mail, address, phone, health data, IP addresses in some contexts) without need; whole request bodies/headers or objects with
toString()that include them - LG5 warning: string formatting/concatenation instead of parameterized or structured logging (
log.info("user " + id), f-strings in Python logging) - costs time even when the level is off and loses structure - LG6 warning: missing context - no request/correlation ID, user or entity ID, operation name, so a log line can't be traced back
- LG7 warning:
print,console.log,System.out.println,Console.WriteLine,printfin production code instead of the project logger (Godot/Unity: unguarded debug prints in shipped builds) - LG8 error: exception logged without stack trace or cause (only
e.getMessage()/str(e)) - LG9 info: the same error logged at several levels of the call stack →
error-handling-reviewEH12 - LG10 warning: log injection - user input with line breaks or control characters logged unescaped (forged log lines)
- LG11 info: inconsistent message style (mixed languages, tenses, formats); no level configuration per environment
- LG12 info: expensive computation in log arguments without a level guard or lazy evaluation
False positives to drop
CLI tools whose job is printing to stdout (LG7) · logs of IDs that are not personal data · intentionally verbose DEBUG logs that are off in production · print in scripts, notebooks and tests.
Report
In the user's language, grouped by file:
path/to/file:line - error|warning|info - <ID> <rule> - <what is logged or missing and why it matters, e.g. "a failed payment leaves no trace"> - direction: <what the log should contain or omit>- Every finding has a concrete location. LG4: name the data type, never copy the actual sensitive values into the report.
- Mark findings that depend on runtime configuration you couldn't see (levels, filters) as "possible".
- Bulk hits with one root cause (e.g. 80
console.logcalls): report once with count and 2-3 samples. - End with a summary: logging setup as found, findings per severity, then the 3 most important things to fix first.
- Do not change code. Apply fixes only when the user explicitly asks for it.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

