Configuration issues with RollingFileAppender

483 views
Skip to first unread message

Brent Cromarty

unread,
Jan 31, 2013, 6:10:26 PM1/31/13
to netflix...@googlegroups.com
Hey all.  Wondering if anyone has had success with configuring a RollingFileAppender with the AsyncAppender?

I have been working on integrating bltiz4j in to a project for a while now and have hit an issue that I cannot seem to resolve.  I have found that when trying to use a RollingFileAppender with the blitz4j AsyncAppender the file size and backup limit settings are not enforced.  At least not when I configure them via a log4j.properties file or custom properties file (defined via -Dlog4j.configuration).  If I set properties with an instance of java.util.Properties through LoggingConfiguration.getInstance().configure(props) the RollingFileAppender appears to work as that I can see the file size limit being enforced and backup files being created.  But if I try to set the exact same properties in a properties file, the log file created just grows (seemingly) unbounded, suggesting that the RollingFileAppender is not being used at all.

At first I thought the issue was related to the recent fix for loading log4j.properties off the classpath ("shouldLoadLog4jProperties"), however I have tried to use that property (using version 1.21) in my configuration files without success.  I have been debugging through the code and cannot see where the RollingFileAppender is actually wrapped any of the blitz4j classes.

My properties file looks like this:

netflix.blitz4j.shouldLoadLog4jProperties=false

log4j.rootLogger=DEBUG,file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=pingaccess.log
log4j.appender.file.MaxFileSize=100MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=com.netflix.logging.log4jAdapter.NFPatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c:%L - %m%n
log4j.appender.file.Append=true
log4j.appender.file.Threshold=DEBUG
log4j.rootCategory=OFF
log4j.logger.asyncAppenders=DEBUG,file

Anyone have any ideas or suggestions?  Any info or idea are appreciated.

Sincerely,

Brent
Reply all
Reply to author
Forward
0 new messages