logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <...@qos.ch>
Subject Re: Question: LocationInfo : %M, %L, %l
Date Sat, 24 Feb 2001 09:26:50 GMT


Have a look at the Category.log(String callerFQN, Priority priority, Object message, Throwable
t) method. It should solve the problem you mention. Set the callerFQN to the fully qualified
name of your wrapper/utility class. Cheers, Ceki

At 00:14 24.02.2001 -0800, Ye Tao wrote:
>Hey gurus
>For various reasons I am wrapping the log4j API's in a
>homegrown Logger utility class. For example, I have an
>info() method that calls Category.info() internally. 
>The problem that I have now is with the location
>information generated by %M, %L, or %l. The
>LocationInfo.java obtains the location information by
>parsing the stack trace printouts. It always return
>the method just one frame up in the stack above 
>org.apache.log4j.Category.log(), which in my case is
>the info() method in my homegrown utility. This
>basically leaves the %M, %L, %l useless to me as they
>always report the location as in the utility class
>instead of the one that calls the info() method. 
>Is there any way around it? Like can I override the
>default behavior from LocationInfo?
>thanks a ton.
>Do You Yahoo!?
>Get email at your own domain with Yahoo! Mail. 
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

Ceki Gülcü          Web:   http://qos.ch      
av. de Rumine 5     email: cgu@qos.ch (preferred)
CH-1005 Lausanne           ceki_gulcu@yahoo.com
Switzerland         Tel: ++41 21 351 23 15

View raw message