Setting Destinations for Log Files
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Corey_Potter
Posted On:   Wednesday, July 23, 2003 07:55 AM

Is this a way to set a destination for the log file outputs in the configuration file? Or does this require a java code change?

Re: Setting Destinations for Log Files

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, July 23, 2003 12:03 PM

log4j.appender.Appender1=org.apache.log4j.RollingFileAppender


log4j.appender.Appender1.File=/tmp/our.log




That is from a log4j.properties file here.

And then for our loggers in addition to specifying the level, we also give that Appender1 name so they will use it.

e.g. if our code does Logger.getLogger("com.our"), we put the config line in as:

log4j.logger.com.our=DEBUG, Appender1


Unfortunately, in a web app, while this IS working with Weblogic (writing to /tmp/our.log), it is NOT working with JBoss (our logs still go to the "server.log" along with org.jboss, org.apache etc. crap)!

perhaps JBoss will not let a web app write to the "/tmp" of the underlying filesystem, so we will have to try some relative path instead of the fully-qualified one (when we get around to it)...

About | Sitemap | Contact