Migrate SLF4J to Log4j 2.x API
MSALTransforms code written using SLF4J to use Log4j 2.x API.
org. openrewrite. java. logging. log4j. Slf4jToLog4jmod run . --recipe= org. openrewrite. java. logging. log4j. Slf4jToLog4jInstall 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.
- Change method target to static
- Change method target to static
- Change method target to static
- Change method name
org.apache.logging.log4j.CloseableThreadContext putCloseable(..)toput - Change method target to static
- Change method name
org.apache.logging.log4j.ThreadContext clear(..)toclearAll - Change method target to static
- Change method target to static
- Change method target to static
- Change method name
org.slf4j.spi.LoggingEventBuilder addMarker(..)towithMarker - Change method name
org.slf4j.spi.LoggingEventBuilder setCause(..)towithThrowable - Change type
org.slf4j.Loggertoorg.apache.logging.log4j.Logger - Change type
org.slf4j.event.Leveltoorg.apache.logging.log4j.Level - Change type
LoggingEventBuildertoLogBuilder - Change type
org.slf4j.Markertoorg.apache.logging.log4j.Marker - Change type
MDCCloseabletoCloseableThreadContext$Instance - Change type
MDCtoCloseableThreadContext - Change Gradle or Maven dependency
org.slf4j:slf4j-api - Replace any Lombok log annotations with target logging framework annotation
- Add imports for fully qualified references to types