You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "lh0156 (via GitHub)" <gi...@apache.org> on 2026/08/02 22:58:20 UTC

[PR] KAFKA-19470: Cache Scala logger wrappers [kafka]

lh0156 opened a new pull request, #23044:
URL: https://github.com/apache/kafka/pull/23044

   Closes KAFKA-19470
   
   ### Summary
   
   - Cache the immutable Scala logger wrapper by logger name in `kafka.utils.Logging`.
   - Preserve custom `loggerName` overrides by using the resolved name as the cache key.
   - Add a regression test proving that multiple instances with the same logger name share the wrapper.
   
   `Logging.logger` was previously initialized independently for every object instance. The underlying SLF4J logger is name-based, so the wrapper can be reused safely. A `ConcurrentHashMap` keeps the lookup thread-safe while allowing concurrent construction to converge on one cached wrapper.
   
   ### Tests
   
   - `./gradlew :core:test --tests kafka.utils.LoggingTest --no-build-cache --rerun-tasks --console=plain`
   - `./gradlew :core:spotlessCheck --no-build-cache --console=plain`
   
   The regression test was first verified to fail against the base branch, then passed after the cache implementation was added. Core Checkstyle and SpotBugs also passed as part of the test build.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-19470: Cache Scala logger wrappers [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23044:
URL: https://github.com/apache/kafka/pull/23044#issuecomment-5235600843

   A label of 'needs-attention' was automatically added to this PR in order to raise the
   attention of the committers. Once this issue has been triaged, the `triage` label
   should be removed to prevent this automation from happening again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org