我的日志文件中出现重复条目。在下面附上了我的 log4j.properties。
log4j.properties:
###############################################################################
# log4j Configuration file: Defines following loggers
# SL - Standard root Logger
# EL - Error Logger with the threshold level explicitly set to ERROR
# DL - Data base logger - to log db queries separately
# BL - Batch logger
###############################################################################
log4j.rootLogger=TRACE,SL,EL
log4j.rootLogger.additivity=false
#Standard Log
log4j.appender.SL=org.apache.log4j.DailyRollingFileAppender
log4j.appender.SL.File=${log.file}/log.log
log4j.appender.SL.layout=org.apache.log4j.PatternLayout
log4j.appender.SL.layout.ConversionPattern=[%5p] [%t %d{HH:mm:ss:SSS}] [%X{sessionId}:%X{hostId}:%X{userId}] (%F:%M:%L) %m%n
#Error Log
log4j.appender.EL=org.apache.log4j.DailyRollingFileAppender
log4j.appender.EL.File=${log.file}/error.log
log4j.appender.EL.layout=org.apache.log4j.PatternLayout
log4j.appender.EL.Threshold=ERROR
log4j.appender.EL.layout.ConversionPattern=[%5p] [%t %d{HH:mm:ss:SSS}] [%X{sessionId}:%X{hostId}:%X{userId}] (%F:%M:%L) %m%n
# Database Log
log4j.logger.org.springframework.jdbc=DEBUG,DL
log4j.appender.DL=org.apache.log4j.DailyRollingFileAppender
log4j.appender.DL.File=${log.file}/db.log
log4j.appender.DL.layout=org.apache.log4j.PatternLayout
log4j.appender.DL.layout.ConversionPattern=[%5p] [%t %d{HH:mm:ss:SSS}] [%X{sessionId}:%X{hostId}:%X{userId}] (%F:%M:%L) %m%n
#Forecast Log
log4j.appender.MAPS_FC=org.apache.log4j.DailyRollingFileAppender
log4j.appender.MAPS_FC.File=${log.file}/forecast.log
log4j.appender.MAPS_FC.layout=org.apache.log4j.PatternLayout
log4j.appender.MAPS_FC.layout.ConversionPattern=[%5p] [%t %d{HH:mm:ss:SSS}] [%X{sessionId}:%X{hostId}:%X{userId}] (%F:%M:%L) %m%n
#Logger configuration
log4j.logger.com.singaporeair.maps=TRACE,SL,EL
log4j.logger.com.singaporeair.maps.app.service.impl.gantt=DEBUG,MAPS_FC
log4j.logger.com.singaporeair.maps.app.dao.impl.gantt=DEBUG,MAPS_FC
在上面配置的log.log文件中获取重复条目。
日志提取:
[ INFO] [SimpleAsyncTaskExecutor-9 19:04:00:800] [::] (AppProfiler.java:doProfile:69) Processing Time(ms): BaseDAOImpl: getBatchDetails: 63
[ INFO] [SimpleAsyncTaskExecutor-9 19:04:00:800] [::] (AppProfiler.java:doProfile:69) Processing Time(ms): BaseDAOImpl: getBatchDetails: 63
[ INFO] [SimpleAsyncTaskExecutor-9 19:04:00:800] [::] (AppProfiler.java:doProfile:71) BaseDAOImpl: getBatchDetails: OUT
[ INFO] [SimpleAsyncTaskExecutor-9 19:04:00:800] [::] (AppProfiler.java:doProfile:71) BaseDAOImpl: getBatchDetails: OUT
请帮忙