spring-fleet-logging-setup
Skill2 starsChanged 44 days agoMITView on GitHub
Use when fleet logs are console-only or scattered and cross-service correlation needs a stable location - installs a logback convention so every service writes <logDir>/<service>.log with OTel trace_id / span_id and legacy sessionId / requestId in the pattern.
In this repository10 other files it gives its agents.
- debugging-runtime-logsSkill
- debugSkill
- doctorSkill
- federating-mcp-serversSkill
- fleet-initSkill
- impactSkill
- logsSkill
- runSkill
- traceSkill
- tracing-across-servicesSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Primary: OpenTelemetry / Micrometer Observation: Add the spring-boot-starter-actuator + micrometer-tracing-bridge-otel (or, on Spring Boot …
- Distinctive: line 21
Fallback / legacy: sessionId, requestId: Keep them in the pattern for fleets that pre-date the Observation API or that propagate an …
- Distinctive: line 57
Verify: Run the service, exercise one request, then:
- Very specific: line 66
Keep the same pattern across services so timestamps sort cleanly when merged.
≈ “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
Fleet Logging Setup (logback convention)
Cross-service log correlation needs two things: every service writing to one
known directory, and trace keys (trace_id, span_id, sessionId, …) present
in each line. This skill installs a logback convention that guarantees both. It
is idempotent and opt-in per service.
What trace keys to use (2026)
- Primary: OpenTelemetry / Micrometer Observation. Add the
spring-boot-starter-actuator+micrometer-tracing-bridge-otel(or, on Spring Boot 4, the dedicatedspring-boot-starter-opentelemetry). The W3Ctraceparentheader is auto-propagated across HTTP/gRPC, and the Observation API automatically populates MDC keystrace_id(32-char hex) andspan_id(16-char hex). These are the modern, framework-default keys. - Fallback / legacy: sessionId, requestId. Keep them in the pattern for fleets that pre-date the Observation API or that propagate an application- level session id (auth, X-Request-Id) the user wants to correlate on.
When to use
/debugreports missing log files, or logs only go to the IDE console.- Logs exist but lack a trace key, so correlation falls back to timestamps.
Procedure
- Read the config for
logDirandtraceKeys. - Start from the template:
${CLAUDE_PLUGIN_ROOT}/logback/logback-spring.xml. For each service you want covered, place it at<service-repo>/src/main/resources/logback-spring.xml(or merge its appender- pattern into the existing one), then customize three things:
SERVICE_NAME→ the service'snamefrom the config (used as the log file base name, so/debugcan find it).- The
%X{...}keys inFLEET_PATTERN→ one per entry intraceKeys. SPRING_FLEET_LOG_DIR→ the configlogDir, or set that env var when launching the service.
- Ensure the trace keys are in MDC. A pattern can only print
%X{trace_id}if something puttrace_idinto the MDC.- trace_id / span_id: come for free once Micrometer Tracing or the OTel starter is on the classpath; Spring Boot wires the Observation API which populates MDC automatically. Verify by hitting any endpoint and tailing the log; the keys should already be there.
- sessionId / requestId (legacy): usually require a filter/interceptor
that reads the incoming header (or generates the id), calls
MDC.put(...), and clears it in afinally. If propagation across services is missing, the same id must be forwarded as a header on outbound proxy-lib calls. (Modern fleets should rely on W3Ctraceparentinstead and treat sessionId as a business id, not a correlation id.)
- Verify. Run the service, exercise one request, then:
Confirm lines land inpython "${CLAUDE_PLUGIN_ROOT}/scripts/tail_logs.py" \ --config ./spring-fleet.config.json --service <name> --lines 20<logDir>/<service>.logand carry the trace key.
Notes
- Keep the same pattern across services so timestamps sort cleanly when
merged. The template's
yyyy-MM-dd HH:mm:ss.SSSprefix is what the correlator parses. - The template also keeps a
CONSOLEappender, so IDE output is unchanged. - For services you will not modify, prefer the (future)
/runtee approach instead of editing their logback config.
Outside Claude Code
${CLAUDE_PLUGIN_ROOT}is the spring-fleet plugin root. Claude Code fills it in; in Codex it is the folder two directories above this SKILL.md.
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.

