The Logger component helps you log important messages, errors, and the status of an application. It’s helpful when debugging and monitoring your application.
You can simply drag and drop the Logger component from the Mule palette into any flow or subflow, as shown in the following figure. To configure Logger, you need to fill in Message, which could be with a simple String or a DataWeave script. Make sure you do not log any sensitive information, as it’ll be retained.
You can view the application logs here: MULE_HOME/logs/<app-name>.log. You can also configure the path and customize the logging tools (Splunk or ELF, for example) explicitly in log4j.xml.
As you can see in the following figure, INFO (default) is the default Level input – the other levels are DEBUG, ERROR, TRACE, and WARN. Setting log levels will help you to filter out certain logs while debugging.
You can also club logs into a different category. In order to categorize logs, you can set Category to String.
Comments
Post a Comment
Please Write your comment here.