搞砸了webapp中的Log4J配置

时间:2013-05-25 15:03:00

标签: tomcat log4j

我在Tomcat 7中运行的webapp再次重复相同的日志消息6次。例如:

[INFO] 1
29042 [http-nio-8443-exec-4] INFO com.lni.exchange.healthvault.ParseMeasurement  - 1
29042 [http-nio-8443-exec-4] INFO com.lni.exchange.healthvault.ParseMeasurement  - 1
29042 [http-nio-8443-exec-4] INFO com.lni.exchange.healthvault.ParseMeasurement  - 1
29042 [http-nio-8443-exec-4] INFO com.lni.exchange.healthvault.ParseMeasurement  - 1
29042 [http-nio-8443-exec-4] INFO com.lni.exchange.healthvault.ParseMeasurement  - 1
29042 [http-nio-8443-exec-4] INFO com.lni.exchange.healthvault.ParseMeasurement  - 1

预期的写入输出只是第一行([INFO] 1),但后来我得到了6条重复的消息。有没有人知道为什么消息重复这么多次?可能搞砸了我的log4j属性,这对我来说一直有点混乱。

我使用Spring进行Axis2 1.6.2部署,接收数据并将其发送到HealthVault。

这是log4j属性文件:

# Set root category priority to INFO and its only appender to CONSOLE.
#log4j.rootCategory=INFO, CONSOLE
log4j.rootCategory=INFO, CONSOLE, LOGFILE

# Set the enterprise logger priority to FATAL
log4j.logger.org.apache.axis2.enterprise=FATAL
log4j.logger.de.hunsicker.jalopy.io=FATAL
log4j.logger.httpclient.wire.header=FATAL
log4j.logger.org.apache.commons.httpclient=FATAL

# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%p] %m%n

# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=axis2.log
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n

2 个答案:

答案 0 :(得分:0)

这不是Tomcat,这是部署到它的一些应用程序。问app dev。

答案 1 :(得分:0)