Skip to content

[NIFI-14707] Use a single logger for TimedLock#10064

Merged
exceptionfactory merged 1 commit intoapache:mainfrom
esecules:NIFI-14707-TimedLock-logger
Jul 3, 2025
Merged

[NIFI-14707] Use a single logger for TimedLock#10064
exceptionfactory merged 1 commit intoapache:mainfrom
esecules:NIFI-14707-TimedLock-logger

Conversation

@esecules
Copy link
Contributor

@esecules esecules commented Jul 3, 2025

Summary

NIFI-14707
Go with the simple approach to use a single logger for all instances of TimedLock and its debuggable counterpart. If you all still want the ability to configure logging on a specific TimedLock instance please drop a comment. I just wanted to get a PR up with the simplest solution.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 21

Licensing

  • N/A New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • N/A New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • N/A Documentation formatting appears as expected in rendered files

Copy link
Contributor

@exceptionfactory exceptionfactory 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 digging into this issue @esecules. I agree that this change is going in the right direction, creating numerous loggers is definitely wasteful.

I recommend going a step further and initializing the logger statically, since it will always be the same, it doesn't need to be an instance member variable.

…rt and make sure that all log messages include the lock name
@esecules esecules force-pushed the NIFI-14707-TimedLock-logger branch from 6817350 to 21fb937 Compare July 3, 2025 15:10
@esecules
Copy link
Contributor Author

esecules commented Jul 3, 2025

Thanks for digging into this issue @esecules. I agree that this change is going in the right direction, creating numerous loggers is definitely wasteful.

I recommend going a step further and initializing the logger statically, since it will always be the same, it doesn't need to be an instance member variable.

Done. Thanks.

Copy link
Contributor

@exceptionfactory exceptionfactory 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 the adjustment and discovering this latent issue, looks good! +1 merging

@exceptionfactory exceptionfactory merged commit 38f265e into apache:main Jul 3, 2025
6 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.

2 participants