Skip to content

Split migration from Log4j 1 to Log4j 2 API and Log4j 2 Core #154

Open
@ppkarwasz

Description

@ppkarwasz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrecipeRecipe Requested

    Type

    No type

    Projects

    Status

    Recipes Wanted

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions