Replace Log4j 2.x active Level check with corresponding SLF4J method calls
MSALReplace calls to Logger.isEnabled(Level) with the corresponding SLF4J method calls.
org. openrewrite. java. logging. slf4j. Log4j2IsEnabledToSlf4jRecipesmod run . --recipe= org. openrewrite. java. logging. slf4j. Log4j2IsEnabledToSlf4jRecipesInstall 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.
- Replace Log4j 2.x
Logger.isEnabled(Level.TRACE)with SLF4J'sLogger.isTraceEnabled() - Replace Log4j 2.x
Logger.isEnabled(Level.DEBUG)with SLF4J'sLogger.isDebugEnabled() - Replace Log4j 2.x
Logger.isEnabled(Level.INFO)with SLF4J'sLogger.isInfoEnabled() - Replace Log4j 2.x
Logger.isEnabled(Level.WARN)with SLF4J'sLogger.isWarnEnabled() - Replace Log4j 2.x
Logger.isEnabled(Level.ERROR)with SLF4J'sLogger.isErrorEnabled()