Log4j2 and Logback are the two most used logging frameworks in Java, both built on the SLF4J API.
1. Log4j2
See the full Log4j2 Tutorial for configuration, appenders, filters and layouts.
2. Logback
See the full Logback Tutorial for configuration, appenders and layouts.
3. Shared Topics (SLF4J, MDC)
- Setting Up SLF4J with Logback, Log4j2 and JUL
- SLF4J vs Log4j – Which One is Better?
- Java Logging with Mapped Diagnostic Context (MDC)
- Delete Old Logs on Rollover, with Logback maxHistory
Happy Learning !!