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 test verifying log4j2 updateLoggers is called #5822

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

pativa
Copy link
Contributor

@pativa pativa commented Jan 24, 2025

As a questioned whether the call to updateLoggers is necessary in #5810 I made a quick test verifying that its being called so it can't accidentally be removed 🙂

(made as a separate PR as this test is unrelated to the other change)

@pativa pativa force-pushed the test-log4j-reconfigure branch from 9e154a6 to d78df65 Compare January 24, 2025 07:55
Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

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

Thanks. Could you rebase on 1.13.x and update the target branch to there?

@pativa pativa force-pushed the test-log4j-reconfigure branch from d78df65 to 71a5d6b Compare January 24, 2025 09:04
@pativa pativa changed the base branch from main to 1.13.x January 24, 2025 09:05
@pativa
Copy link
Contributor Author

pativa commented Jan 24, 2025

Sure, it's updated to target 1.13.x now 👍

@pativa pativa changed the title Add test verifying log42j updateLoggers is called Add test verifying log4j2 updateLoggers is called Jan 24, 2025
Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

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

I worry the test may be relying on internal details too much which could make it fragile to later changes, but I'm not sure how else to write the test. It would have caught removing updateLoggers before, so perhaps it's still worth adding and see if fragility becomes an issue.

@@ -186,6 +187,27 @@ void asyncLogShouldNotBeDuplicated() throws IOException {
.until(() -> registry.get("log4j2.events").tags("level", "info").counter().count() == 3);
}

// see https://github.com/micrometer-metrics/micrometer/pull/872
Copy link
Member

Choose a reason for hiding this comment

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

Should we also add @Issue("#867")?

Copy link
Member

Choose a reason for hiding this comment

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

We can, though I guess 867 is linked to from 872. Obviously out of scope for this PR, but since you reminded me, I wonder if we should get rid of that @Issue annotation entirely since we have no tooling that uses it and so it doesn't seem to add value over a comment without an annotation.

@shakuzen shakuzen merged commit e73ead8 into micrometer-metrics:1.13.x Jan 28, 2025
7 checks passed
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.

3 participants