logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jin xin" <jx_ch...@hotmail.com>
Subject quesiton about LoggingEvent
Date Tue, 19 Dec 2006 03:25:23 GMT
Hi:

I use the following code

Class testClass
{

public void test1()
{
---
Throwable throwable = null;
Throwable child = new Throwable("test");
LoggingEvent loggingEvent = new 
LoggingEvent(this.getClass().getName(),testLogger,Level.DEBUG,logMsg,child);
System.out.println("class = 
"+loggingEvent.getLocationInformation().getClassName());
System.out.println("method = 
"+loggingEvent.getLocationInformation().getMethodName());
System.out.println("line = 
"+loggingEvent.getLocationInformation().getLineNumber());---
---}
}
I am expecting to see the className, methodName and lineNumber to print out, 
however, I only get "?" for classNamem methodName and lineNumber.

Can anybody advise me what I did wrong?

Thanks

_________________________________________________________________
Off to school, going on a trip, or moving? Windows Live (MSN) Messenger lets 
you stay in touch with friends and family wherever you go. Click here to 
find out how to sign up!  http://www.telusmobility.com/msnxbox/


---------------------------------------------------------------------
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