Skip to content

Logger Framework — Notes#

Functional#

  • Hierarchical loggers (com.foo.bar).
  • Levels per logger.
  • Multiple appenders + formatters.
  • Filters.
  • MDC / structured fields.
  • Async + sync delivery.

Non-functional#

  • Sub-µs hot path when level disabled.
  • No log loss under burst (lossless async + bounded queue).
  • No deadlocks (re-entrant logging).

Trade-offs#

  • Sync is simple but blocks on slow appender; async decouples but loses on crash unless flushed.
  • JSON vs text: JSON wins for aggregation; text wins for greppable local files.
  • Per-thread context (MDC) invaluable for request tracing.

Refs#

  • Log4j 2, Logback, SLF4J architecture docs.
  • "Logger frameworks comparison" articles.