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-505579381
 
 
   > There should be no risk of a memory leak if log() is not called. The 
LogBuilders are owned by a thread local. If log() is not called then the next 
call to an "at" method would clear them for re-use. Even if one was dynamically 
created it would be garbage collected as soon as the it went out of scope.
   
   Some applications record errors infrequently, I don't think it's sufficient 
to hold the previous parameters until the next time a logger is used with an 
enabled level. I've fixed a couple permutations of this issue in our existing 
message/event implementations based on third party bug reports.
   
   I don't think it's a problem if we hold a reference to an object array of 
null values, but if we hold references to dynamically provided parameter 
objects I think it can cause issues.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to