1 / 13

MULE LOGGING

This presentation describes an example which shows how to log different levels of LOG messages

Télécharger la présentation

MULE LOGGING

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MULE LOGGING BY POLAKI SAIRAM

  2. Mule Logger • We use the Logger component to log messages such as error messages, status notifications, or exceptions. • We can add a logger anywhere in a flow, and you can configure it to log anything: any string, any Mule expression, or any combination of strings and Mule expressions. • We can log 5 different levels of log messages in mule. They are ERROR, WARN, INFO, DEBUG and TRACE. The default level is INFO.

  3. Logger - Example

  4. Logger - Example

  5. Logger - Example INFO 2017-06-23 11:45:12,276 [[logger1].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor: This is INFO message

  6. Logger - Example ERROR 2017-06-23 11:50:04,295 [[logger1].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor: This is ERROR message

  7. Logger - Example ERROR 2017-06-23 11:50:04,295 [[logger1].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor: This is ERROR message

  8. Logger - Example Observe that DEBUG level logs are not logged in console. This is due to we are using default log4j2 configuration which logs messages of level greater than equal to INFO and DEBUG’s level is lesser than INFO.

  9. LOG4J2.XML File

  10. LOG4J2.XML File Customization Change “org.mule” classes level to DEBUG and trigger the DEBUG request. Observe that many DEBUG logs are logged during the start of application.

  11. LOG4J2.XML File Customization Another way to log this particular message is by changing http logger level to DEBUG.

  12. Configuring Custom Logging Settings • To configure custom logging settings at server level change $MULE_HOME/conf/log4j2.xml file. • In Anypoint Studio, log4j2.xml appears in the src/main/resources path. • To use custom logging settings file sepeicfylog.configFile to log-settings-file.xml(someFileName) in mule-deploy.properties. The path to log-settings-file.xml can be either relative to working directory or an absolute path.

  13. Configuring Custom Logging Settings • If this deployment property isn’t set, when an application is deployed, Mule looks for a config file following a child-first pattern, as listed below: • 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.

More Related