rewrite-logging-frameworks
rewrite-logging-frameworks copied to clipboard
OpenRewrite recipes for assisting with Java logging migration tasks.
## What problem are you trying to solve? When logging exceptions using SLF4J or Log4j API, a common mistake is to add a placeholder for the exception in the message...
## What problem are you trying to solve? Loglevel guards ( such as `if (LOG.isDebugEnabled())`) are a performance improvement to prevent building up logging statement arguments when the log line...
It would be great if there was a Recipe to convert between things like log4j.properties or log4j.xml to logback.xml etc.
### Problem Reformatting occurs when no other modifications are made. ### Expected behavior When no changes are made to a logging callsite, no modifications should occur to the formatting. ###...
I was reading the documentation [here](https://docs.openrewrite.org/reference/recipes/java/logging/logback) and can see log4j2 to logback conversion is supported. But there is no way to convert vice versa (from logback to log4j2). Are there...
SLF4J 2.0.0 has been released: https://www.slf4j.org/faq.html#changesInVersion200 That means we can now adopt the fluent logging api: https://www.slf4j.org/manual.html#fluent I expect this to be most useful around guard blocks such as the...
It is inefficient to have sequences of logger invocations at the same level: ```java logger.info("foo"); logger.info("bar"); ``` These would be better combined into a single invocation
Sometimes parameters to logging invocations include expensive computations which are pointless if the log level isn't set such that the message will actually be recorded. It would be useful to...
Pet peeve: IDE warnings about unused loggers added through Lombok annotations. While we already have [Remove unused private fields](https://docs.openrewrite.org/reference/recipes/java/cleanup/removeunusedprivatefields), this does not take into account loggers added through for instance...