Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[logging] Upgrade Log4j2 version to 2.14.0 and replace legacy log4j dependency #8880

Merged
merged 1 commit into from
Dec 10, 2020

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Dec 9, 2020

Motivation

Upgrade to most recent Log4j2 version to keep it updated. Replace legacy log4j dependency with API facade for legacy API

Modifications

  • Upgrade Log4j2 version to 2.14.0

  • replace legacy log4j dependency with log4j-1.2-api

  • import Log4j2's BOM into Pulsar's dependency management instead of
    defining versions separately for each Log4j2 library

  • distribution/server/pom.xml included log4j:log4j dependency.

    • replace with org.apache.logging.log4j:log4j-1.2-api to
      keep supporting the legacy logging api in the case something
      depends on it

…ndency with log4j-1.2-api

- import Log4j2's BOM into Pulsar's dependency management instead of
  defining versions separately for each Log4j2 library

- distribution/server/pom.xml included log4j:log4j dependency.
  - replace with org.apache.logging.log4j:log4j-1.2-api to
    keep supporting the legacy logging api in the case something
    depends on it
@@ -97,8 +97,8 @@
</dependency>

<dependency>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This depedency could be possibly removed alltogether, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check that after investigating why the legacy log4j dependency was there previously.

@@ -95,8 +95,8 @@
</dependency>

<dependency>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
<groupId>org.apache.logging.log4j</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this we need the read depedency, since this determines what goes inside the distribution tar

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review.
I'm just trying to understand that how the legacy log4j dependency is used. The log4j-1.2-api as part of Log4j2 provides the legacy log4j API but routes the log events to log4j2. I'd assume that this would be the correct approach if legacy log4j and log4j2 co-exist.
However is legacy log4j even needed? I see that legacy log4j is excluded from many dependencies. mvn dependency:tree didn't give a direct answer, but I can try to investigate by temporarily removing the exclusions locally.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I got confused with log4j2. I think here we're adding this dependency because of ZK. Your change is probably the correct one then.

@sijie sijie added this to the 2.8.0 milestone Dec 9, 2020
@merlimat merlimat merged commit 2e1fb05 into apache:master Dec 10, 2020
zymap pushed a commit that referenced this pull request Mar 2, 2021
…ndency with log4j-1.2-api (#8880)

- import Log4j2's BOM into Pulsar's dependency management instead of
  defining versions separately for each Log4j2 library

- distribution/server/pom.xml included log4j:log4j dependency.
  - replace with org.apache.logging.log4j:log4j-1.2-api to
    keep supporting the legacy logging api in the case something
    depends on it

(cherry picked from commit 2e1fb05)
@lhotari lhotari added release/2.7.4 cherry-picked/branch-2.7 Archived: 2.7 is end of life labels Dec 10, 2021
lhotari added a commit that referenced this pull request Dec 10, 2021
…t. Replace legacy log4j with log4j-1.2-api

backports PR #8880 to branch-2.7
[logging] Upgrade Log4j2 version to 2.14.0, replace legacy log4j dependency with log4j-1.2-api (#8880)

- import Log4j2's BOM into Pulsar's dependency management instead of
  defining versions separately for each Log4j2 library

- distribution/server/pom.xml included log4j:log4j dependency.
  - replace with org.apache.logging.log4j:log4j-1.2-api to
    keep supporting the legacy logging api in the case something
    depends on it

(cherry picked from commit 2e1fb05)
lhotari added a commit to datastax/pulsar that referenced this pull request Dec 10, 2021
…ndency with log4j-1.2-api (apache#8880)

- import Log4j2's BOM into Pulsar's dependency management instead of
  defining versions separately for each Log4j2 library

- distribution/server/pom.xml included log4j:log4j dependency.
  - replace with org.apache.logging.log4j:log4j-1.2-api to
    keep supporting the legacy logging api in the case something
    depends on it

(cherry picked from commit 2e1fb05)
(cherry picked from commit fe963bc)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Dec 10, 2021
…t. Replace legacy log4j with log4j-1.2-api

backports PR apache#8880 to branch-2.7
[logging] Upgrade Log4j2 version to 2.14.0, replace legacy log4j dependency with log4j-1.2-api (apache#8880)

- import Log4j2's BOM into Pulsar's dependency management instead of
  defining versions separately for each Log4j2 library

- distribution/server/pom.xml included log4j:log4j dependency.
  - replace with org.apache.logging.log4j:log4j-1.2-api to
    keep supporting the legacy logging api in the case something
    depends on it

(cherry picked from commit 2e1fb05)
(cherry picked from commit 6fee20f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants