dcsimg
log4j: why no location information for my own classes
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Sunday, April 11, 2004 03:43 AM

Hi!

I am using LF5 for displaying logging information, but i don't get location information for my own classes. Indeed location information for other classes (e.g. org.apache.log4j.net.SimpleSocketServer) is provided.



Any idead what is missing?



I traced the code and found some locations with LocationInfo code and that in default case NO location information will be send to client.



So why is there such a different behaviour for my and other classes? Yes, debug option (-g) is on!



And ideads?



Thank you in advance



Fireball

Re: log4j: why no location information for my own classes

Posted By:   Mohammad_Shamsi  
Posted On:   Wednesday, June 2, 2004 12:42 AM


Hi Mr. Fireball



use a simple filter to solve this problem



Class SetLocationInfoFilter extends Filter {



public int decide(LoggingEvent event) {



event.getLocationInformation();



return Filter.NEUTRAL;



}



}



this simple method causes that location info set befor



sendding loggingevent to the client (socket or database or ...)



add this filter name to your appender in log4j property
file.



;)
M. H. Shamsi

Re: log4j: why no location information for my own classes

Posted By:   Anonymous  
Posted On:   Sunday, April 11, 2004 03:58 AM

Ok, if found it on my own.

Setting "log4j.appender.SOCKET1.LocationInfo=true" in the log4j configuration file should to the trick for me.

About | Sitemap | Contact