log4j 配置文件 示例
注意 是 log4j 不是 Log4j2!!!
# Configure logging for testing: optionally with log file
log4j.rootLogger=INFO,stdout,logfile
# log4j.rootLogger=WARN, stdout, logfile
#控制台输出
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=Thread:%t-- [%p] - %m [%l]: %d{yyyy MMM dd HH:mm:ss} %n
# 日志记录文件
log4j.appender.logfile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.logfile.Encoding=UTF-8
log4j.appender.logfile.File=E:/cjy_lycyjcpt_dataprocessing/cjy.log
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=Thread\:%t-> [%p] - %m [%l]\: %d{yyyy MMM dd HH\:mm\:ss} %n