Open Source • MIT License

Zero-Boilerplate Java Logging

High-performance logging library for Java 17+ with compile-time annotation processing, async logging via LMAX Disruptor, and comprehensive Spring Boot integration. Inspired by SLF4J, built for modern Java.

Java 17+
Modern JVM Features
10M+
Logs/sec Throughput
Zero
Runtime Reflection

Enterprise-grade logging for modern Java

Open source library with advanced features for production workloads

Open Source
MIT License
6
Maven Modules
Spring Boot
Auto-Config
GraalVM
Native Ready

Built for Modern Java Development

Hermes combines compile-time magic with runtime performance to deliver a logging experience that just works

@InjectLogger Annotation

Zero-boilerplate logging with compile-time annotation processing. No reflection, no runtime overhead.

LMAX Disruptor Async

Lock-free ring buffer for 10M+ logs/sec throughput. Non-blocking publish with background processing.

Spring Boot Integration

Auto-configuration via starter module. YAML config binding and actuator health indicators included.

Kotlin DSL

Idiomatic Kotlin extensions with lazy evaluation, MDC DSL, and structured logging builders.

Multiple Appenders

Console, File, Rolling, Async, Logstash. Pattern and JSON layouts with ThreadLocal optimization.

GraalVM Native Image

Native-image metadata included. Compile-time processing eliminates reflection requirements.

How It Works

Three simple steps from zero to production-ready logging

1

Annotate Your Class

Add @InjectLogger and extend the generated base class. The annotation processor creates a parent class with a protected Logger field during compilation.

2

Build Your Project

Maven compiles your code and the annotation processor generates the base class. Zero runtime reflection means native-image compatibility out of the box.

3

Log Away

Use the inherited log field to write logs. Configure appenders and layouts programmatically or via Spring Boot YAML config.

Module Architecture

Six Maven modules with clear separation of concerns

hermes-api

Core interfaces and annotations (Logger, LoggerFactory, @InjectLogger, MDC, Marker)

hermes-core

HermesLogger implementation, appenders (Console, File, Rolling, Async, Logstash), layouts (Pattern, JSON)

hermes-processor

Compile-time annotation processor that generates base classes with protected Logger fields

hermes-spring-boot-starter

Auto-configuration, HermesProperties YAML binding, health indicators

hermes-kotlin

Idiomatic Kotlin DSL extensions, lazy evaluation, MDC DSL, structured logging

hermes-examples

Working examples and demonstrations for common scenarios

Code Examples

See how easy it is to use Hermes in your Java or Kotlin projects

java
@InjectLogger
public class UserService extends UserServiceHermesLogger {
    public void createUser(String username) {
        log.info("Creating user: {}", username);
        
        try {
            // Business logic here
            log.debug("User created successfully");
        } catch (Exception e) {
            log.error("Failed to create user", e);
        }
    }
}

Use Cases

Hermes adapts to your architecture and deployment needs

Microservices

Lightweight footprint and async logging for high-throughput services with minimal latency impact.

Spring Boot Applications

Auto-configuration and YAML binding for seamless integration with Spring Boot ecosystem.

High-Throughput Systems

LMAX Disruptor async appender delivers 10M+ logs/sec without blocking application threads.

Kotlin Projects

Idiomatic Kotlin DSL with lazy evaluation and structured logging for modern JVM applications.

Native Image Deployments

GraalVM native-image compatible with zero reflection and compile-time processing.

Cloud-Native Apps

JSON logging with Logstash appender for centralized log aggregation and monitoring.

Quick Start

Add Hermes to your project in seconds

1. Add Dependencies

xml
<dependency>
    <groupId>io.github.dotbrains</groupId>
    <artifactId>hermes-api</artifactId>
    <version>1.0.0</version>
</dependency>
<dependency>
    <groupId>io.github.dotbrains</groupId>
    <artifactId>hermes-core</artifactId>
    <version>1.0.0</version>
    <scope>runtime</scope>
</dependency>

<!-- For annotation processing -->
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <annotationProcessorPaths>
                    <path>
                        <groupId>io.github.dotbrains</groupId>
                        <artifactId>hermes-processor</artifactId>
                        <version>1.0.0</version>
                    </path>
                </annotationProcessorPaths>
            </configuration>
        </plugin>
    </plugins>
</build>

2. Use @InjectLogger

java
@InjectLogger
public class UserService 
    extends UserServiceHermesLogger {
    
    public void processUser(User user) {
        log.info("Processing user: {}", 
                 user.getId());
        
        try {
            // Your business logic
            log.debug("User processed");
        } catch (Exception e) {
            log.error("Error: {}", 
                     e.getMessage(), e);
        }
    }
}

💡 Pro tip: The annotation processor will generate UserServiceHermesLogger with a protected log field during compilation.

Ready to Get Started?

Join the community and start building with zero-boilerplate Java logging today