title: How to enable hdfs and mapred audit logs?
body: <p>I am hadoop-2.6.0 user in windows. I want to enable hdfs and mapred logs. I could enable hdfs audit log by setting the following property in <strong>hadoop-env.cmd</strong> but cannot enabled audit log for mapred.</p>
  
  <pre><code>set HDFS_AUDIT_LOGGER=INFO,RFAAUDIT
  </code></pre>
  
  <p>If i set the above variable in hadoop-env.cmd then hdfs-audit.log file stored in the %HADOOP_LOG_DIR%.</p>
  
  <p>I want to enable mapred audit logging. In log4j.properties available in the %HADOOP_HOME%\etc\hadoop, i could see the logging properties for mapred which is pasted below</p>
  
  <p><strong>mapred audit logging</strong></p>
  
  <pre><code>mapred.audit.logger=INFO,NullAppender
  mapred.audit.log.maxfilesize=256MB
  mapred.audit.log.maxbackupindex=20
  log4j.logger.org.apache.hadoop.mapred.AuditLogger=${mapred.audit.logger}
  log4j.additivity.org.apache.hadoop.mapred.AuditLogger=false
  log4j.appender.MRAUDIT=org.apache.log4j.RollingFileAppender
  log4j.appender.MRAUDIT.File=${hadoop.log.dir}/mapred-audit.log
  log4j.appender.MRAUDIT.layout=org.apache.log4j.PatternLayout
  log4j.appender.MRAUDIT.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n
  log4j.appender.MRAUDIT.MaxFileSize=${mapred.audit.log.maxfilesize}
  log4j.appender.MRAUDIT.MaxBackupIndex=${mapred.audit.log.maxbackupindex}
  </code></pre>
  
  <p>But cannot enable mapred audit logging. When i change the following properties then an empty file <strong>mapred-audit.log</strong> stored in the %HADOOP_LOG_DIR%.</p>
  
  <pre><code>mapred.audit.logger=INFO,MRAUDIT
  -
  -
  -
  log4j.additivity.org.apache.hadoop.mapred.AuditLogger=true
  -
  -
  </code></pre>
  
  <p>How can i enable mapred audit logs?</p>
  
  <p>Help would be greatly appreciated.</p>