On Mar 15, 2005, at 2:21 PM, Jason Roscoe wrote:
I am brand spanking new to log4j. I have the following configuration file:
# Set root category priority to DEBUG and set its only appender to Console
log4j.rootCategory=DEBUG, Console, R
# Console is set to be a ConsoleAppender (writes to system console). log4j.appender.Console=org.apache.log4j.ConsoleAppender
# R is set to be a RollingFileAppender (writes to file). log4j.appender.R=org.apache.log4j.rolling.RollingFileAppender log4j.appender.R.File=bouncebacks.log log4j.appender.R.MaxFileSize=100KB
# Keep one backup file log4j.appender.R.MaxBackupIndex=1
# R uses PatternLayout. log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
# Console uses PatternLayout.
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=[%5p]: (%C{1}.%M:%L) - %m%n
# dynamic log reader "Chainsaw" # connects to chainsaw reader which must be running separately # ex) java -classpath [path]/log4j.jar org.apache.log4j.chainsaw.Main log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender log4j.appender.Chainsaw.remoteHost=localhost log4j.appender.Chainsaw.port=4445
log4j.appender.Chainsaw.locationInfo=true
When I run my application, I get these errors:
[ERROR]: (ConfiguratorBase.detachListAppender:96) - No output stream or file
set for the appender named [R].
[ WARN]: (PropertySetter.setProperty:173) - No such property [maxFileSize]
in org.apache.log4j.rolling.RollingFileAppender.
[ WARN]: (PropertySetter.setProperty:173) - No such property [maxBackupIndex] in org.apache.log4j.rolling.RollingFileAppender.
[ WARN]: (RollingFileAppender.activateOptions:86) - Please set a TriggeringPolicy for the RollingFileAppender named 'R'
Can someone help me get this to write to a file?
log4j 1.3 introduced a replacement (org.apache.log4j.rolling.RollingFileAppender) for the previous RollingFileAppender (org.apache.log4j.RollingFileAppender, notice the missing .rolling). Your configuration is attempting to configure the new RollingFileAppender with the properties for the old RFA.
In the last week, I added to the CVS an emulation of the old RFA that delegates to the new RFA so that existing configuration files will still work.
Depending on your circumstances, you could:
configure the new RFA and have a configuration file that only works with 1.3 or later.
configure the old RFA and have a configuration file that works with 1.2 and the CVS HEAD, but no released version of 1.3.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
