logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Stauffer" <stauffer.ja...@gmail.com>
Subject Re: Extracting information from log4j messages
Date Tue, 30 May 2006 15:06:01 GMT
Look at the code to see how it gets that info.

On 5/30/06, zimske <zimske@gmail.com> wrote:
>
> Hello
>
> I'd like to know if there's a way to extract detailed information from the
> message that is generated with the defined pattern. I'm aware of
> getThreadName(), getMessage() methods and so forth. However, my layout
> formats the message with following pattern: %d{ABSOLUTE} %5p (%l) - [%c] -
> %m%n. The message looks like this:
>
> 14:42:42,618  INFO (test.Test.main(Test.java:18)) - [test.Test] - BLAH BLAH
>
> for the method call
>
> logger.info("BLAH BLAH");
> However, getMessage method will simply return "BLAH BLAH".
>
> So, basically, through patterns I can get detailed information of what
> happened, when it happened, and where it happened. Can I get these
> information (method, package, line number) through log4j API as well?
>
>
> --
> View this message in context: http://www.nabble.com/Extracting+information+from+log4j+messages-t1704397.html#a4626356
> Sent from the Log4j - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message