openrewrite / openrewrite/rewrite-logging-frameworks
Split migration from Log4j 1 to Log4j 2 API and Log4j 2 Core
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 34
- Forks
- 32
- Avg merge
- 6h 32m
- Merged PRs (30d)
- 3
Description
What problem are you trying to solve?
The Migrate Log4j 1.x to Log4j 2.x recipe, provides steps that:
- migrate usages of Log4j 1 in code to usages of Log4j 2 API,
- migrate the logging backend from Log4j 1 to Log4j 2 Core, which only involves changes to Maven or Gradle dependencies.
The second set of migration rules could be refactored into a separate (and faster) recipe.
Nowadays most applications don't use Log4j API in their code: since 2002 JCL and SLF4J have replaced the usage of Log4j 1 in code almost entirely.
However there is a niche of users that kept using Log4j 1 (and its clone Reload4J) as logging backend. These users might be interested in a recipe that only reconfigures their runtime classpath and converts their configuration files.
Describe the solution you'd like
I would like to move the rules that change dependencies from the Log4j1ToLog4j2 recipe to a new Log4j1ToLog4j2Core recipe and use the latter in the former.
Are you interested in contributing this feature to OpenRewrite?
I will contribute this feature in late Q3 2023, enhanced with a Log4j 1 to Log4j 2 configuration format converter.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the Log4j1ToLog4j2 recipe at the linked documentation page and identify the rules that change Maven or Gradle dependencies. Move those rules into a Log4j1ToLog4j2Core recipe and have the original recipe use it. Done means backend-only migration can run separately while the existing recipe retains its full behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100