[ 
https://issues.apache.org/jira/browse/LOG4J2-2639?focusedWorklogId=266915&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-266915
 ]

ASF GitHub Bot logged work on LOG4J2-2639:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Jun/19 18:20
            Start Date: 25/Jun/19 18:20
    Worklog Time Spent: 10m 
      Work Description: carterkozak commented on issue #284: LOG4J2-2639 - 
Allow logging calls to be constructed using a builder pattern
URL: https://github.com/apache/logging-log4j2/pull/284#issuecomment-505562983
 
 
   I'm worried about memory leaks in calls that never invoke `log()`
   
   ```java
   logger.info().message("Hello, {}!", "World").marker(getMarker() /* throws! 
*/).log();
   ```
   
   In this case, we would apply data to a message factory, building a message 
object, but never release threadlocal parameter references.
   
   We could do something along the lines of `info(Consumer<LogBuilder>)` and 
remove `build()` from the LogBuilder, however the fluent usage would never be 
garbage free. We would get a guarantee that we could release resources on both 
success and failure, but the API would be more difficult to use.
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 266915)
    Time Spent: 4h 40m  (was: 4.5h)

> Allow log event to be created using the builder pattern.
> --------------------------------------------------------
>
>                 Key: LOG4J2-2639
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2639
>             Project: Log4j 2
>          Issue Type: Task
>          Components: API
>    Affects Versions: 3.0.0
>            Reporter: Ralph Goers
>            Priority: Major
>          Time Spent: 4h 40m
>  Remaining Estimate: 0h
>
> In some cases it would be convenient to create log events using a builder 
> pattern. One advantage of this approach is that it would allow the location 
> information to be more easily provided.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to