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

Add apollo-plugin-log4j2 module to support log4j2.xml integration #6

Merged
merged 8 commits into from
Dec 21, 2022

Conversation

nisiyong
Copy link
Member

@nisiyong nisiyong commented Dec 13, 2022

What's the purpose of this PR

Add apollo-log4j2 module to support log4j2.xml integration, I have extended this module for a long time, and it works well in our production practice. I think it is better to discuss this with the community.

Which issue(s) this PR fixes:

Brief changelog

  • Extend org.apache.logging.log4j.core.config.ConfigurationFactory, ref docs: log4j/2.x/manual/customconfig
  • By default, it will load log4j2.xml in the classpath, when apollo.log4j2.enabled=true, log4j2 will load the configuration from apollo.

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.
  • Update the CHANGES log.

@codecov
Copy link

codecov bot commented Dec 13, 2022

Codecov Report

Merging #6 (672d2fa) into main (0a7b041) will increase coverage by 0.03%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main       #6      +/-   ##
============================================
+ Coverage     67.80%   67.84%   +0.03%     
- Complexity     1164     1165       +1     
============================================
  Files           165      165              
  Lines          5109     5109              
  Branches        559      559              
============================================
+ Hits           3464     3466       +2     
+ Misses         1377     1376       -1     
+ Partials        268      267       -1     
Impacted Files Coverage Δ
.../apollo/internals/RemoteConfigLongPollService.java 78.44% <0.00%> (+1.19%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Anilople
Copy link
Contributor

It looks great!

pom.xml Show resolved Hide resolved
# Apollo Log4j2

This module could let you integrate log4j2 with apollo easily.
You could create a namespace `log42.xml`, then log4j2 will load the configuration from it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, the docs will be updated if this PR was approved.

@nisiyong nisiyong changed the title Add apollo-log4j2 module to support log4j2.xml integration Add apollo-plugin-log4j2 module to support log4j2.xml integration Dec 15, 2022
Anilople
Anilople previously approved these changes Dec 15, 2022
Copy link
Contributor

@Anilople Anilople left a comment

Choose a reason for hiding this comment

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

LGTM

@nisiyong
Copy link
Member Author

We haven't update the CHANGES.md.

Co-authored-by: Jason Song <nobodyiam@gmail.com>
Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

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

LGTM

@nobodyiam nobodyiam merged commit 0560bf5 into apolloconfig:main Dec 21, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2022
@nisiyong nisiyong deleted the apollo-log4j2 branch December 21, 2022 02:05
@nobodyiam nobodyiam added this to the 2.1.0 milestone Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants