logback.xml配置:




%d{yyyy-MM-dd HH:mm:ss.SSS} %level [%thread] %class:%line >> %msg%n



/home/report/logs/opt/jfpay_task_bat_log/task.log

/home/report/logs/opt/jfpay_pm_out_log/task.%d{yyyy-MM-dd}.log
30


[%date{yyyy-MM-dd HH:mm:ss}] [%-5level] [%logger:%line] --%mdc{client} %msg%n



/home/report/logs/opt/jfpay_pm_out_log/job.log

/home/report/logs/opt/jfpay_pm_out_log/task.%d{yyyy-MM-dd}.log
30


[%date{yyyy-MM-dd HH:mm:ss}] [%-5level] [%logger:%line] --%mdc{client} %msg%n





    
    

log4j配置:

log4j.rootLogger=info,D,E
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
#stdout
log4j.logger.info=D
log4j.appender.D=org.apache.log4j.DailyRollingFileAppender
log4j.appender.D.File=/home/weblogic/logs/prepo/jfpay_prepo_info.log
log4j.appender.D.Append = true
log4j.appender.D.Threshold = info
log4j.appender.D.layout=org.apache.log4j.PatternLayout
log4j.appender.D.layout.ConversionPattern=%d %p [%c] - %m%n

log4j.logger.error=E
log4j.appender.E=org.apache.log4j.DailyRollingFileAppender
log4j.appender.E.File=/home/weblogic/logs/prepo/error/jfpay_prepo_error.log
log4j.appender.E.Append = true
log4j.appender.E.Threshold = error
log4j.appender.E.layout=org.apache.log4j.PatternLayout
log4j.appender.E.layout.ConversionPattern=%d %p [%c] - %m%n

以上配置仅供参考