Skip to content

Conversation

@JerryShea
Copy link

LoggerContext.getContext(false) can be very expensive - instead get the context from the logger. Also reduce work (and allocations) for the common case of no metadata

…direct from the logger, and reduce allocations in the common path
@google-cla
Copy link

google-cla bot commented Aug 8, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

* which can perhaps be installed as default if nothing else is present. Then, we would not rely
* on Log4j2 internals.
*/
LoggerContext ctx = LoggerContext.getContext(false);
Copy link
Author

@JerryShea JerryShea Aug 10, 2025

Choose a reason for hiding this comment

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

this can be very expensive

@cpovirk cpovirk added P3 type=enhancement Make an existing feature better labels Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 type=enhancement Make an existing feature better

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants