Mule - 运行Mule Standalone时无法在终端中看到日志

时间:2014-03-07 16:55:51

标签: maven logging terminal mule mule-studio

我正在使用Mule Studio 3.5.0开发Mule应用程序,然后使用Maven(从终端)打包并部署到Mule Standalone 3.4.0。当我从Studio运行我的应用程序时,我可以看到控制台中的所有日志,但是,当我在独立模式下从终端运行它时,我看不到以下任何内容 - 但我的应用仍然按预期运行。如何让日志显示在终端窗口中?

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app                'test-app'                    +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO  2014-03-07 16:12:41,049 [WrapperListener_start_runner] org.mule.module.launcher.StartupSummaryDeploymentListener: 

**********************************************************************
*            - - + APPLICATION + - -            * - - + STATUS + - - *
**********************************************************************
* default                                       * DEPLOYED           *
* test-app                                      * DEPLOYED           *
**********************************************************************

INFO  2014-03-07 16:12:41,053 [WrapperListener_start_runner] org.mule.module.launcher.MuleDeploymentService: 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Mule is up and kicking (every 5000ms)                    +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

我的log4j.properties文件如下:

# 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
################################################

# CXF is used heavily by Mule for web services
log4j.logger.org.apache.cxf=WARN

# Apache Commons tend to make a lot of noise which can clutter the log.
log4j.logger.org.apache=WARN

# Reduce startup noise
log4j.logger.org.springframework.beans.factory=WARN

# Mule classes
log4j.logger.org.mule=INFO

2 个答案:

答案 0 :(得分:2)

默认情况下,特定于应用程序的日志记录转到每个应用程序的日志记录,即$ {MULE_HOME} / logs / $ {app.name} .log

如果您希望应用程序日志仅转到控制台,则可以将simpleLog设置为explained here

如果您要在应用程序日志和控制台中同时记录,则应在自定义应用程序log4j配置中配置控制台appender和文件追加器

答案 1 :(得分:1)

查看$ {MULE_HOME} /logs/mule_ee.log。这是控制台输出被记录的地方。