Skip to content

Add option to provide URIs to monitor in addition to the config file #3501

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

Closed
wants to merge 13 commits into from

Conversation

MichaelMorrisEst
Copy link
Contributor

@MichaelMorrisEst MichaelMorrisEst commented Feb 26, 2025

A change detected in either the config file itself or the provided additional URIs shall result in a reconfigure
See #3074

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)

@vy vy self-assigned this Mar 14, 2025
@vy vy added api Affects the public API configuration Affects the configuration system in a general way labels Mar 14, 2025
Copy link
Member

@vy vy left a comment

Choose a reason for hiding this comment

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

@MichaelMorrisEst, thanks so much for putting effort into this, much appreciated! 😍

I've dropped some remarks. I'd appreciate it if you can update the PR with requested changes. I will have some more remarks – e.g., adding docs – but I will share them last.

@MichaelMorrisEst
Copy link
Contributor Author

Thanks for your comments @vy. The comment to use a dedicated element instead of an attribute changes the implementation quiet a bit. Please take a look when you have time, feedback gratefully received. Thanks!

Copy link
Member

@vy vy left a comment

Choose a reason for hiding this comment

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

@MichaelMorrisEst, I am extremely thankful for your effort and patience. I've some questions. I'd appreciate it if you can address them.

Copy link

github-actions bot commented Apr 13, 2025

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

Copy link
Member

@vy vy left a comment

Choose a reason for hiding this comment

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

Would you mind also updating configuration.adoc such that

  1. Just before Arbiters section, create a Monitor URIs section.
  2. Link Monitor URIs and #configuration-attribute-monitorInterval to each other with sufficient text and explanation.

A change detected in either the config file itself or the provided additional URIs shall result in a reconfigure

Signed-off-by: MichaelMorris <michael.morris@est.tech>
…ribute of the Configuration element

Signed-off-by: MichaelMorris <michael.morris@est.tech>
Signed-off-by: MichaelMorris <michael.morris@est.tech>
Signed-off-by: MichaelMorris <michael.morris@est.tech>
@ppkarwasz ppkarwasz added this to the 2.25.0 milestone May 19, 2025
@vy
Copy link
Member

vy commented May 19, 2025

@MichaelMorrisEst, would you mind giving me write access to your fork, please? I want to push some changes and get this merged for 2.25.0, which we will be releasing in 1-2 weeks.

@MichaelMorrisEst
Copy link
Contributor Author

@MichaelMorrisEst, would you mind giving me write access to your fork, please? I want to push some changes and get this merged for 2.25.0, which we will be releasing in 1-2 weeks.

Hi @vy, I think I gave you access a few months ago for another PR, can you check and let me know if there is a problem

@vy
Copy link
Member

vy commented May 20, 2025

I think I gave you access a few months ago for another PR, can you check and let me know if there is a problem

@MichaelMorrisEst, see the following failure. Am I missing something?

$ git push git@github.com:Nordix/logging-log4j2.git Nordix-issue-3074:issue-3074
ERROR: Permission to Nordix/logging-log4j2.git denied to vy.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

(Nordix-issue-3074 is my local branch, where I also happen to execute the command from.)

@MichaelMorrisEst
Copy link
Contributor Author

Ive added you there now @vy , you should get notification

@vy
Copy link
Member

vy commented May 20, 2025

@MichaelMorrisEst, nope, I haven't gotten it yet. Can you merge (not rebase!) the upstream 2.x to your local issue-3074, and push your changes, please? I will base my work on that tip and send you a patch.

@vy
Copy link
Member

vy commented May 20, 2025

Have just seen the invitation in an inbox I wasn't expecting. 😮‍💨

Pushed my changes. In short, renamed MonitorUri to MonitorResource, improved tests, and some other minor changes. @MichaelMorrisEst, do you have any further remarks?

@MichaelMorrisEst
Copy link
Contributor Author

Have just seen the invitation in an inbox I wasn't expecting. 😮‍💨

Pushed my changes. In short, renamed MonitorUri to MonitorResource, improved tests, and some other minor changes. @MichaelMorrisEst, do you have any further remarks?

Looks good, I've no further remarks

Copy link
Contributor

@ppkarwasz ppkarwasz left a comment

Choose a reason for hiding this comment

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

Thank you all for the work you've put into this contribution — it's shaping up to be a valuable addition for users!

I’ve reviewed the code and it looks great overall. I do have a few concerns about the proposed syntax for the Java Properties configuration format, and I’d love to discuss them further to ensure we’re aligned with the existing conventions and the future goals for 3.x.

Signed-off-by: MichaelMorris <michael.morris@est.tech>
Copy link
Contributor

@ppkarwasz ppkarwasz left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my suggestions on processing the *.properties format!

Your changes cover the newly introduced monitorResources element well. However, there’s another lesser-known configuration element—AsyncWaitStrategyFactory—that’s still unsupported in the Java Properties format.

What do you think about the approach below to handle both elements together?

@ppkarwasz ppkarwasz linked an issue May 25, 2025 that may be closed by this pull request
@ppkarwasz ppkarwasz removed this from the 2.25.0 milestone May 25, 2025
- Use builder pattern for MontiorResource
- Handle AsyncWaitStrategyFactory in properties file as well, in a generic way

Signed-off-by: MichaelMorris <michael.morris@est.tech>
@MichaelMorrisEst
Copy link
Contributor Author

Thanks for addressing my suggestions on processing the *.properties format!

Your changes cover the newly introduced monitorResources element well. However, there’s another lesser-known configuration element—AsyncWaitStrategyFactory—that’s still unsupported in the Java Properties format.

What do you think about the approach below to handle both elements together?

I played around with it and think it worked out quiet well I think, was able to re-use some existing methods, so I've pushed with the changes

@vy vy requested a review from ppkarwasz May 28, 2025 16:05
Copy link
Contributor

@ppkarwasz ppkarwasz left a comment

Choose a reason for hiding this comment

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

This looks great! 💯

There is only one task remaining: the removal of the unused MonitorResourceComponentBuilder class.

Signed-off-by: MichaelMorris <michael.morris@est.tech>
@vy
Copy link
Member

vy commented May 31, 2025

Created #3703 to fix the commit signatures. (I did not want to force-push into this PR to avoid truncating git and GitHub conversations history.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Affects the public API configuration Affects the configuration system in a general way
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants