Hi everyone,
I've implemented it very similarly:
# Log4j Configuration
log4j.loggerFactory=er.extensions.logging.ERXLogger$Factory
log4j.rootCategory=INFO, A1, A2
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=er.extensions.logging.ERXPatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{MMM dd HH:mm:ss} %$[%#] %-5p %c %x - %m%n
log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.file=${WOOutputPath}
log4j.appender.A2.datePattern='.'yyyyMMddHHmm
log4j.appender.A2.append=true
log4j.appender.A2.layout=er.extensions.logging.ERXPatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{MMM dd HH:mm:ss} %$[%#] %-5p %c %x - %m%n
The only difference is that I'm using the WOOutputPath as the file path (highlighted above). This works great except that the default logging system for my app seems to be clashing with my the DailyRollingFileAppender, such that when I start the app up, I get 2 log files. It looks like the log file generated by the DailyRollingFileAppender gets initialized first, then some code in WOApplication sees it and appends a timestamp to it, then continues to log to the WOOutputPath.
Does anyone have any ideas as to how to deal with this? Like switch off the default logging?
Any help would be greatly appreciated.
Thanks,
Ben