vy commented on code in PR #3333: URL: https://github.com/apache/logging-log4j2/pull/3333#discussion_r1899185445
########## src/site/antora/modules/ROOT/pages/faq.adoc: ########## @@ -181,25 +181,25 @@ It creates a new message object for each call. == How do I log my domain object without creating garbage? One option is to let the domain object implement `CharSequence`. -However, for many domain objects it may not be trivial to implement this without allocating temporary objects. +However, for many domain objects, it may not be trivial to implement this without allocating temporary objects. -An alternative is to implement the `org.apache.logging.log4j.util.StringBuilderFormattable` interface. -If an object is logged that implements this interface, its `formatTo(StringBuilder)` method is called instead of `toString()`. +An alternative is implementing the `org.apache.logging.log4j.util.StringBuilderFormattable` interface. +If an object that implements this interface is logged, its `formatTo(StringBuilder)` method is called instead of `toString().` [#logger-wrapper] == How do I create a custom logger wrapper that shows the correct class, method, and line number? -Log4j remembers the fully qualified class name (FQCN) of the logger and uses this to walk the stack trace for every log event when configured to print location. +Log4j remembers the logger's fully qualified class name (FQCN) and uses this to walk the stack trace for every log event when configured to print location. [WARNING] ==== Be aware that logging with location is slow and may impact the performance of your application. ==== -The problem with custom logger wrappers is that they have a different FQCN than the actual logger, so Log4j can't find the place where your custom logger was called. +The problem with custom logger wrappers is that they have a different FQCN than the actual logger, so Log4j can't find where your custom logger was called. The solution is to provide the correct FQCN. -The easiest way to do this is to let Log4j generate the logger wrapper for you. +The easiest way is to let Log4j generate the logger wrapper for you. Log4j comes with a Logger wrapper generator tool. This tool was originally meant to support custom log levels and was moved to the {logging-services-url}/log4j/transform/latest/index.html[Log4j Transform subproject]. Review Comment: @ppkarwasz, good catch, yes, we should. -- 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: notifications-unsubscr...@logging.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org