title: Rotate and compress HDFS Audit-Logs
body: <p>i want to modify the Log4J configuration of the HDFS audit-log. The Log-Files have to be compress, if the filesize is greater than 100MB or at end of business. Files have to be rotate endloss.</p>
  
  <p>I habe to tried to edit the log-configuration but the filesize will be ignore. </p>
  
  <p>Best regards</p>
  
  <p>Dominik</p>
  
  <h3>hdfs audit logging</h3>
  
  <pre><code> hdfs.audit.logger=INFO,console
   log4j.logger.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=${hdfs.audit.logger}
   log4j.additivity.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=false
   log4j.appender.DRFAAUDIT=org.apache.log4j.rolling.RollingFileAppender
   log4j.appender.DRFAAUDIT.File=${hadoop.log.dir}/hdfs-audit.log
   log4j.appender.DRFAAUDIT.layout=org.apache.log4j.PatternLayout
   log4j.appender.DRFAAUDIT.layout.ConversionPattern=%d{ISO8601} %p %c: %m%
   log4j.appender.DRFAAUDIT.rollingPolicy=org.apache.log4j.rolling.FixedWindowRollingPolicy
   log4j.appender.DRFAAUDIT.MaxBackupIndex=2
   log4j.appender.DRFAAUDIT.triggeringPolicy=org.apache.log4j.rolling.SizeBasedTriggeringPolicy
   log4j.appender.DRFAAUDIT.MaxFileSize=100MB
   log4j.appender.DRFAAUDIT.rollingPolicy.ActiveFileName=${hadoop.log.dir}/hdfs-audit.log
   log4j.appender.DRFAAUDIT.rollingPolicy.FileNamePattern=${hadoop.log.dir}/hdfs-audit-%i.log.gz
  </code></pre>