org.apache.log4j.spi.LoggingEvent has the following method that does the expensive Throwable():
/**
Set the location information for this logging event. The collected
information is cached for future use.
*/
public LocationInfo getLocationInformation() {
if(locationInfo == null) {
locationInfo = new LocationInfo(new Throwable(), fqnOfCategoryClass);
}
return locationInfo;
}
How is this cached and does that mean the new Throwable() is only running once per log statement?
--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/4ac5e2e5-6012-4699-be04-f794de47a94d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to op...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/6ba4d6a6-3b91-487c-9fff-ccd5f664cd8e%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/CAAdXmhrC3JUFF7Z%2Br9dstsseBkZ9UV-%3DjG1mdbgcwrRZkEZhgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Theoretically, it might be possible to somehow "remember" the lines involved, so the Throwable is only done once. Since the performance improvement would be massive, it might be interesting to look at that. no ideal solution comes to my mind.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/CADmm%2BKeySjYkAEHeOPeVN%3DeV_kh3hNvZRUkdY-Jsp8Frhj46ag%40mail.gmail.com.