hadoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eremikhin Alexey <a.eremi...@corp.badoo.com>
Subject log4j.appender.DRFA.MaxBackupIndex is not it nonsense!?
Date Thu, 17 Apr 2014 10:28:35 GMT
Hi everyone!
I've started looking about logs retention on Hadoop and noticed 
interesting option in default Hadoop log4j.properties configuration
# 30-day backup
# log4j.appender.DRFA.MaxBackupIndex=30

I've enabled it and it produced no effect on existing files even after 
rotation happened. That caused me start reading source code of log4j.
There is a base class FileAppender which has 2 children 
RollingFileAppender(RFA) and DailyRollingFileAppender(DRFA).

RFA enumerates files ascending and on each rotation increases log file 
id from 1 up to MaxBackupIndex and removes last file.

DRFA uses date to distinct logs files but has no retention techniques 

That means MaxBackupIndex can't have any effect on DRFA at all. And that 
means property name log4j.appender.DRFA.MaxBackupIndex has no sense and 
no effect.
You can easily google this parameter and find plenty complaints it does 
not work.

Yes there are some projects about adding retention to DRFA but these 
classes have different names.
http://wiki.apache.org/logging-log4j/DailyRollingFileAppender - 

You can find this parameter even in last stable distribution.

What I'm doing wrong? 8-\

View raw message