Control spring logs in WAS

1.      Make Spring use the log4j as the underlying logging system.

Option 1:
Add a file named "org.apache.commons.logging.LogFactory" in META-INF/services directory of the war file. The file content is as below

org.apache.commons.logging.impl.Log4jFactory

Option 2:
Set the application class loader mode to PARENT_LAST.

Add a file named "commons-logging.properties" to the classpath and specify the implementation of commons logging. The file content is as below

org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4Jlogger

2.      Config spring log level in logging.xml

<category name="org.springframework" additivity="false">
    <priority value="WARN"/>
    <appender-ref ref="Warn"/>
</category>

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

Back to Top