logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adedokun, Bisi" <adedo...@toysrus.com>
Subject RE: Specifying Different Location for Log File
Date Fri, 28 Nov 2003 15:37:35 GMT
> Hello,
> I'm using log4j in a struts application. I'd like to specify a different
> location for the log file. Presently, the log file is written to the
> $[WSAD_ROOT] which is C:\Program Files\IBM\WebSphere Studio\Application
> Developer\v5.1. I have specified different location in the
> log4j.properties file but it does not write to the specified location. Is
> there a way to do this in log4j? I have gone through the log4j API, FAQ
> and documentation and I did not see any entry regarding writing log file
> to a different location. I'm I missing something?
> Below is a sample entry in the log4j.properties file:
> log4j.appender.R=org.apache.log4j.RollingFileAppender
> log4j.appender.R.maxBackupIndex=1
> log4j.appender.R.append=true
> log4j.appender.R.bufferSize=8192
> log4j.appender.R.file=weblog.log
> log4j.appender.R.bufferedIO=false
> log4j.appender.R.immediateFlush=true
> log4j.appender.R.maximumFileSize=102400
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> log4j.appender.R.layout.conversionPattern=%d [%t] %-5p %c %M.%L %x - %m%n
> log4j.appender.R.layout.contentType=text/plain
> # stdout is set to Consoleappender
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> # stdout uses PatternLayout
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
> log4j.rootCategory=DEBUG, R, stdout
> What I would like to be able to do is to specify a different location for
> the file property:
> log4j.appender.R.file=d:\logs\weblog.log
> Any insight into how to go about this will be appreciated.
> Bisi
This email message is for the sole use of the intended recipient (s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. To reply to our email administrator directly, send
an email to EmailAdmin@toysrus.com. 
Toys "R" Us, Inc.

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

View raw message