On Dec 4, 2006, at 9:37 AM, val wrote:
Since last time i used
Configuration for LOG4CXX 0.9.7:
log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.File=output/temp
log4j.appender.R.DatePattern=.%Y-%m-%d-%H-%M
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S,%Q}
[%t] %-5p
%.16c - %m%n
it works very well. But now i use version 0.10.0
and this configuration doesn't work wel:
log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.R.File=output/temp
log4j.appender.R.DatePattern=.%Y-%m-%d-%H-%M
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd
HH:mm:ss,SSS} [%t]
%-5p %.16c - %m%n
What is difference between 0.9.7 and 0.10.0 for
DailyRollingFileAppender
Configurator.
log4cxx 0.9.7 only supported strftime ("%Y...") type format
specifiers which were not supported by log4j. 0.10.0 now supports
java.util.SimpleDateFormat style format specifiers (to be compatible
with log4j configuration files) but will try to detect strftime
format specifiers for compatibility with log4cxx 0.9.7 configuration
files. the 0.10.0 implementation uses apr_strftime which may behave
differently than the native strftime (most commonly %Q is not
supported).
I would suggest changing the DatePattern to a SimpleDateTime format
specifier and see what happens. That is:
log4j.appender.R.DatePattern='.'yyyy-MM-dd_HH_mm
I don't know why the period is quoted in the tests/input/rolling/
obsoleteDRFA1.properties where I borrowed the fragment.
I did modify tests/input/rolling/obsoleteDRFA1.properties in my
working copy to use strftime style format specifiers but the test
still passed, so I'm not sure what problem you are seeing.
Your format string would not get you one file per day, but would get
you one file per minute, but I assume that you knew that.