logback-config-rfc-27_skill

This skill helps you configure RFC-27 compliant logback settings for Java services, enabling environment-specific, rotation-ready logging with console and JSON
  • JavaScript

35

GitHub Stars

1

Bundled Files

3 weeks ago

Catalog Refreshed

2 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstart where the catalogue uses aiagentskills.

npx veilstart add skill bitsoex/bitso-java --skill logback-config-rfc-27

  • SKILL.md5.1 KB

Overview

This skill provides an RFC-27 compliant static Logback configuration for Java services, focused on clear structure, environment-specific profiles, and production-friendly output. It explains where to place logback-spring.xml, which appenders and encoders to use, and deployment practices like not committing logback.xml to version control. Use it to set up or review consistent logging across services.

How this skill works

The configuration uses a root <configuration> element with springProfile blocks to apply different appenders and log levels per environment. It includes Console and RollingFile appenders, JSON encoding for production via LogstashEncoder, and encoder patterns for development. Logger overrides and async appenders are used to control noise and minimize runtime impact.

When to use it

  • Setting up logging for a new Java service using Spring Boot
  • Reviewing or auditing existing logback.xml/logback-spring.xml files
  • Configuring environment-specific logging (local, dev, staging, production)
  • Setting up log rotation, retention, and non-blocking appenders
  • Preparing logs for structured downstream processing (JSON/Logstash)

Best practices

  • Place logback-spring.xml in src/main/resources and avoid committing environment-specific logback.xml files
  • Use <springProfile> to separate local (human-friendly) and production (JSON) formats
  • Prefer ConsoleAppender for containers and RollingFileAppender for node-level persistence
  • Use LogstashEncoder for structured JSON with MDC keys (traceId, spanId) in production
  • Wrap appenders with AsyncAppender for high-throughput services to avoid blocking I/O

Example use cases

  • Local development: ConsoleAppender with human-readable pattern and DEBUG root level
  • Production: ConsoleAppender emitting JSON via LogstashEncoder and INFO root level
  • Staging: Match production logging format but allow temporary increased verbosity for troubleshooting
  • Microservice with heavy library noise: Add specific logger overrides (e.g., org.apache.kafka -> WARN)
  • Services requiring traceability: include MDC keys like traceId and spanId in JSON encoder

FAQ

logback-spring.xml supports Spring profiles and should be used to avoid committing environment-specific defaults into version control.

How do I include trace IDs in logs?

Add MDC keys to the encoder (e.g., includeMdcKeyName traceId and spanId) when using LogstashEncoder to ensure traceability in JSON logs.

When should I use AsyncAppender?

Use AsyncAppender for any high-throughput or latency-sensitive service to prevent blocking on I/O when writing logs.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational