Hey everyone.
I'm looking into creating a logger framework that will use Log4J2 - I
need this for various reasons.
I know that in some cases, I will want the debug logs to include the
location data (what method and in what line the Logger.debug(...) method
was called).
The problem is, that if I wrap the Log4J2's logger, the location will
always show the wrapping class's call to the logger, as the location.
I read here (
http://logging.apache.org/log4j/2.x/manual/layouts.html#LocationInformation)
that to get the location information, the Log4J2 logger will take a
stack and walk a certain depth in it to find the caller.
Is it possible to make Log4J2 change that depth so it will find the
method that called my wrapper class instead of finding my wrapper class?
--
Thanks
Avi Zohary
- Modify how log4J takes location from the stack Avi Zohary
-