Mule studio 加载 log4j 属性文件,...eclipse\plugins\org.mule.tooling.server.3.3.1_1.3.2.201212121943\mule\tooling\tooling-support-3.3.1.jar
而不是项目根文件夹中提供的文件。
问问题
4749 次
2 回答
2
log4j.properties
应该位于,而src/main/resources
不是根文件夹中。您可以使用log4j.properties
jar 中的文件作为模板,并使用以下命令更改日志记录级别log4j.rootCategory=DESIREDLEVEL, console
:
# Default log level
log4j.rootCategory=INFO, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-5p %d [%t] %c: %m%n
################################################
# You can set custom log levels per-package here
################################################
# Apache Commons tend to make a lot of noise which can clutter the log.
log4j.logger.org.apache=WARN
# Shuts up some innocuous messages if using the JBPM transport
log4j.logger.org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog=ERROR
# Reduce startup noise
log4j.logger.org.springframework.beans.factory=WARN
# Mule classes
log4j.logger.org.mule=INFO
# Your custom classes
log4j.logger.com.mycompany=DEBUG
于 2013-11-06T09:28:42.650 回答
1
我发现一篇文章帮助我在 Mule ESB 3.6 中解决了这个问题。这个 Mulesoft 版本使用 log4j2 并寻找如下配置:
部署应用程序时,Mule 将按照子优先模式查找配置,如下所示:
Look for a file called log4j2-test.xml in the application classpath Look for a file called log4j2.xml in the application classpath Look for a file called log4j2-test.xml in the domain classpath Look for a file called log4j2.xml in the domain classpath Look for a file called log4j2-test.xml in MULE_HOME/conf Look for a file called log4j2.xml in MULE_HOME/conf Apply default configuration.
只需将 logj2.xml 放在类路径中,即在 src/main/resources 中。有用。
文章链接:http: //blogs.mulesoft.org/mule-3-6-asynchronous-logging/
于 2015-05-07T15:24:40.973 回答