-M-Dlog4j.debug=true
Configuring Logging
For logging, Mule ESB uses slf4j, which is a logging facade that discovers and uses a logging strategy from the classpath, such as Log4J or the JDK Logger. By default, Mule includes Log4J, which is configured with a file called log4j.properties
.
The Mule server has a log4j.properties
in its conf
directory, which you can customize when running the server in standalone mode. Additionally, all the examples included with Mule have log4j.properties
files in their conf
directories.
Troubleshooting Logging
I reconfigured Log4J, but nothing happened
This happens because there is another log4j.properties
file on your classpath that is getting picked up before your modified one. To find out which configuration file Log4J is using, add the following switch when starting Mule (or container startup script if you are embedding Mule):
This parameter will write the Log4J startup information, including the location of the configuration file being used, to stdout
. You must remove that configuration file before your modified configuration will work.
I don’t want to use Log4J
You can remove Log4J by deleting log4j-xx.jar
from your Mule classpath. You will then need to check that the logging system you are using is supported by slf4j and put the necessary JAR (unless using JDK Logger) and configuration files on the Mule classpath.
Controlling Logging from JMX
You can expose a manager’s logging configuration over JMX by configuring a Log4J Jmx agent in your Mule configuration file. See JMX Management for more information.