Mule : Logging
This page last changed on Apr 08, 2006 by aperepel.
The following describes how Logging is configured in Mule and how you can change it. The Mule server itself does not ship with a log4j.properties this is because many applications already have Log4J configuration, so throwing another log4j.properties in the mix would confuse things. However, the samples that ship with Mule all have a log4j.properties file for configuring logging. These can be used by your application if you do not already have a logging configuration. TroubleshootingI Don't see any logging output?You need to have a log4j.properties file at the root of your classpath. If you don't have a log4j.properties you can get a simple one here. For more information about configuring Log4J, see their website. I reconfigured Log4J but nothing happenedThis 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 Log4J is using you need to add the following JVM parameter to the Mule start up script (or container start up script if you are embedding Mule) - -Dlog4j.debug=true This will write the Log4J start up information to stdout that includes the location of the configuration being used. You'll need to remove this configuration before your modified configuration will work. I don't want to use Log4JYou just need to remove the log4j-xx.jar from your Mule classpath. You will then need to check that the logging system you are using is supported by commons-logging and put the necessary jar (unless using JDK1.4 Logger) and configuration files on the Mule classpath. At time of writing commons logging supports Log4J versions 1.2x and 1.3x, JDK1.4 Logger, Avalon Logkit, JDK1.3 Lumberjack Logger and an internal SimpleLogger implementation. Controlling Logging from JMXYou can expose a managers logging configuration over JMX by configuring a Log4J Jmx agent in your Mule Xml - <agents> <agent name="Log4jJmx" className="org.mule.management.agents.Log4jAgent"/> </agents> Default JMX Support AgentYou can configure all Jmx Agents with a single class called DefaultJmxSupportAgent. It will register your Mule instance with the following agents -
Just add the following to your configuration - <agent name="JMX" className="org.mule.management.agents.DefaultJmxSupportAgent"/>
The agent does a lot of useful plumbing for JMX, however at the expense of defaulting many parameters. If you find a need to customize some subsystems you could either:
|
Document generated by Confluence on Nov 27, 2006 10:27 |