Skip to content

Hermes โšก

Hermes Logo

CI Build & Test Code Quality Annotation Processor Maven Central

Java Maven Spring Boot Kotlin GraalVM LMAX Disruptor

High-performance logging library for Java with excellent developer experience

Inspired by SLF4J, Hermes is a modern logging library that focuses on performance and developer productivity. Named after the Greek messenger god, Hermes delivers your log messages swiftly and reliably.

Features

  • ๐Ÿš€ Zero-boilerplate logging - Use @InjectLogger annotation for automatic logger field injection
  • โšก High performance - Async logging with LMAX Disruptor and zero-allocation optimization
  • ๐ŸŽฏ Fluent API - Parameterized logging with {} placeholders
  • โš™๏ธ Easy configuration - Configure via application.yaml with sensible defaults
  • ๐Ÿ”ง Spring Boot integration - Auto-configuration support
  • ๐Ÿงต Thread-safe - Built for concurrent applications
  • ๐Ÿ“ MDC support - Mapped Diagnostic Context for contextual logging
  • ๐ŸŽจ Markers - Tag and categorize log messages
  • ๐Ÿ“ Multiple appenders - Console, File, RollingFile, Async with Disruptor
  • ๐Ÿ“Š JSON structured logging - Built-in JSON layout for log aggregation
  • ๐ŸŽฏ Pattern layouts - Customizable log output patterns

Quick Example

import io.github.dotbrains.InjectLogger;

@InjectLogger
public class UserService extends UserServiceHermesLogger {

    public void createUser(String username) {
        log.info("Creating user: {}", username);

        try {
            saveToDatabase(username);
            log.info("User {} created successfully", username);
        } catch (Exception e) {
            log.error("Failed to create user: {}", username, e);
        }
    }
}

Why Hermes?

Zero Boilerplate

No more typing private static final Logger log = LoggerFactory.getLogger(ClassName.class); in every class. Just add @InjectLogger and extend the generated base class.

Performance First

  • Zero-allocation logging with ThreadLocal StringBuilder
  • Async logging powered by LMAX Disruptor for 10M+ logs/second
  • Early exit optimization to avoid formatting when level is disabled

Modern Java

Built for Java 17+, leveraging records, text blocks, and other modern features. Fully compatible with GraalVM native-image.

Getting Started

Head over to the Quick Start Guide to begin using Hermes in your project.

Architecture

Hermes follows a modular architecture:

  • hermes-api: Core interfaces and annotations
  • hermes-core: High-performance implementation
  • hermes-processor: Annotation processor for @InjectLogger
  • hermes-spring-boot-starter: Spring Boot auto-configuration
  • hermes-kotlin: Kotlin DSL extensions
  • hermes-examples: Example applications

Learn more in the Architecture Overview.

Comparison with SLF4J

Feature SLF4J Hermes
Logger injection Manual or Lombok @InjectLogger annotation
Configuration XML/Properties YAML with sensible defaults
Async logging Via Logback/Log4j Built-in with Disruptor
Performance Good Optimized for zero-allocation
Spring Boot External starters Native integration
Java version 8+ 17+ (modern Java features)

License

MIT License - see LICENSE file for details