logging

Standardizes logging levels, parameterization, and redaction for Java Tool, Agent, and RAG workflows.

Updated Sep 20, 2026
One-click install
npx skills add https://github.com/aascer39/codeagent --skill logging-aascer39
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: logging
Source: https://github.com/aascer39/codeagent/tree/main/.agents/skills/logging
Command: npx skills add https://github.com/aascer39/codeagent --skill logging-aascer39

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Inconsistent logging across Java services, Tools, Agents, and RAG pipelines makes debugging painful and risks leaking secrets. This Skill enforces one uniform convention for log levels, parameterized messages, exception handling, truncation, and sensitive-data redaction. ## Core Features & Use Cases - Unified Logger Rules: Mandates Lombok @Slf4j, bans System.out and manual LoggerFactory usage, and defines strict ERROR/WARN/INFO/DEBUG/TRACE level criteria. - Tool, Agent, and RAG Tracing: Specifies DEBUG logging at Tool call boundaries, Agent decision points, and RAG query/retrieval steps, with 500-character truncation for large payloads. - Security & Review Checklist: Requires exception objects be preserved, secrets and full prompts be redacted, and provides a pre-commit review checklist. - Use Case: When adding a new Tool or modifying an Agent stage in a Spring Boot project, apply this Skill so every call, decision, and retrieval is traceable without exposing API keys or file contents. ## Quick Start Apply the logging skill to add compliant log statements to the new Tool class I just created.

Frequently Asked Questions about logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add logging to a Java Spring Boot service class?▼

Add Lombok's @Slf4j annotation to the class and use the injected log object with parameterized messages like log.info("Updating user {}", userId). Do not hand-write LoggerFactory.getLogger or use System.out.println in business code.

What log level should I use for tool and agent calls?▼

Use DEBUG for tool invocations, agent decisions, prompt building, and RAG queries. Reserve INFO for key lifecycle events, WARN for recoverable degradation or denials, and ERROR for failures with the exception object attached.

How should exceptions be logged without losing stack traces?▼

Pass the exception object as the last argument, e.g. log.error("Failed to update, userId={}", userId, e), so the framework prints the full stack. Log each exception only once at the handling boundary to avoid duplicate stacks.

Can I log full tool arguments or RAG retrieved content?▼

No. Arguments and retrieved content must be truncated to 500 characters using an abbreviate helper before logging. Only record summaries, lengths, scores, and sources; use controlled debug switches or files for full payloads.

Why is System.out.println banned in business code?▼

System.out bypasses the unified logging framework, breaking level control, formatting, and traceability. The only exception is CLI user-facing interaction output, which must not carry diagnostic information.