Migrate Log4j 2.x to Logback

MSAL

Migrates usage of Apache Log4j 2.x to using logback as an SLF4J implementation directly. Note, this currently does not modify log4j.properties files.

org.openrewrite.java.logging.logback.Log4jToLogback
mod run . --recipe=org.openrewrite.java.logging.logback.Log4jToLogback

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Migrate Log4j to SLF4J
  2. Migrate Log4j 2.x Appender to logback-classic equivalents
  3. Migrate Log4j 2.x Layout to logback-classic equivalents
  4. Add Gradle or Maven dependency ch.qos.logback:logback-core:latest.release
  5. Add Gradle or Maven dependency ch.qos.logback:logback-classic:latest.release
  6. Add Gradle or Maven dependency org.slf4j:slf4j-api:latest.release
  7. Remove a Gradle or Maven dependency org.apache.logging.log4j:log4j-*