logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sara <sara.valente....@coriant.com>
Subject Log4j property file, FixedWindowRollingPilicy and SizeBasedTriggeringPolicy
Date Wed, 10 Jul 2013 10:06:55 GMT
Hi,

I am using log4j.1.2.17 and apache-log4j-extras-1-1.jar.
I want to implement a rollover mechanism, not depending on time and based on
a certain size.

I have the following configurations in a log4j.property file:

log4j.rootLogger=INFO
log4j.logger.TraceLogger=INFO, TraceLoggerAppender

log4j.appender.TraceLoggerAppender=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.TraceLoggerAppender.rollingPolicy=org.apache.log4j.rolling.FixedWindowRollingPolicy
log4j.appender.TraceLoggerAppender.rollingPolicy.activeFileName=${LOG_DIR_NAME}/trace.log
log4j.appender.TraceLoggerAppender.rollingPolicy.fileNamePattern=Trace%i.log
log4j.appender.TraceLoggerAppender.fixedWindowRollingPolicy.minIndex=1
log4j.appender.TraceLoggerAppender.fixedWindowRollingPolicy.maxIndex=3
log4j.appender.TraceLoggerAppender.triggeringPolicy=org.apache.log4j.rolling.SizeBasedTriggeringPolicy
log4j.appender.TraceLoggerAppender.sizeBasedTriggeringPolicy.maxFileSize=10KB
log4j.appender.TraceLoggerAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.TraceLoggerAppender.layout.conversionPattern=%d{yyMMdd
HH:mm:ss,SSS} %-5p %m%n

With this I can obtain the trace.log file(activebackFileName) but the
backups(Trace1.log, Trace2.log and Trace3.log) are not being created, no
matter the maxFilesize that I use.

What I am doing wrong?
Thanks for helping.




--
View this message in context: http://apache-logging.6191.n7.nabble.com/Log4j-property-file-FixedWindowRollingPilicy-and-SizeBasedTriggeringPolicy-tp38639.html
Sent from the Log4j - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message