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?

 

Thanks!!



Disclaimer: This e-mail message is intended only for the personal use of 
the recipient(s) named above.  If you are not an intended recipient, you 
may not review, copy or distribute this message. If you have received this
communication in error, please notify us immediately by e-mail and delete 
the original message.
This e-mail expresses views only of the sender, which are not to be 
attributed to Rite Aid Corporation and may not be copied or distributed 
without this statement.

Reply via email to