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

Improve configuration error handling of HttpAppender #3438

Merged
merged 9 commits into from
Feb 16, 2025

Conversation

Suvrat1629
Copy link
Contributor

@Suvrat1629 Suvrat1629 commented Feb 6, 2025

This PR introduces improvements to HttpAppender and adds a new test class, HttpAppenderBuilderTest, to enhance test coverage. The changes include:
Updating HttpAppender.java to improve logging behavior.
Adding HttpAppenderBuilderTest.java to verify the builder logic for HttpAppender.
Ensuring that missing configurations (e.g., URL, Layout) correctly log errors.

Fixes #3011

Checklist

  • Base your changes on 2.x branch if you are targeting Log4j 2; use main otherwise
  • ./mvnw verify succeeds (if it fails due to code formatting issues reported by Spotless, simply run ./mvnw spotless:apply and retry)
  • Non-trivial changes contain an entry file in the src/changelog/.2.x.x directory
  • Tests for the changes are provided
  • Commits are signed (optional, but highly recommended)

Copy link

github-actions bot commented Feb 6, 2025

Job Requested goals Build Tool Version Build Outcome Build Scan®
build-macos-latest clean install 3.9.8 Build Scan PUBLISHED
build-ubuntu-latest clean install 3.9.8 Build Scan PUBLISHED
build-windows-latest clean install 3.9.8 Build Scan PUBLISHED
Generated by gradle/develocity-actions

@ppkarwasz
Copy link
Contributor

There are formatting errors in your PR. Run:

./mvnw spotless:apply

to fix them.

@Suvrat1629
Copy link
Contributor Author

@ppkarwasz
./mvnw spotless:apply used this and committed the formatting, what else do i need to do in the PR?

@ppkarwasz
Copy link
Contributor

./mvnw spotless:apply used this and committed the formatting, what else do i need to do in the PR?

We have two style rules for the code:

  • We use the Palantir Java Formatter. This is what spotless:apply can fix.
  • We don't use wildcard imports. You need to configure this in your IDE, e.g. by setting the "Class count to use import with '*'" and related options to 99. I fixed it in ff71db9.

I'll look at your PR in the weekend.

@Suvrat1629
Copy link
Contributor Author

Yeah I just realized that when i ran mvn clean install, I'll keep in mind to avoid wildcard imports next time.

@Suvrat1629
Copy link
Contributor Author

@ppkarwasz gentle ping! Could you please take a look :) Thank you!

@ppkarwasz
Copy link
Contributor

Fixes #3011

@ppkarwasz ppkarwasz merged commit 8c0e3c6 into apache:2.x Feb 16, 2025
9 checks passed
@ppkarwasz
Copy link
Contributor

@Suvrat1629,

Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve configuration error handling of HttpAppender
2 participants