# Pattern format: Date LogLevel LoggerName LogMessage
log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} - %m%n
# Debugging Pattern format: Date LogLevel LoggerName (FileName:MethodName:LineNo) LogMessage
#log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
输出文件可以用变量指定,如上面的:
log4j.appender.DRFA.File=${hadoop.log.dir}/${hadoop.log.file}
Log4j配置详解
Apache Log4j 2 更多内容请看: