Saturday, September 1, 2018

Mule 3.9: Separate Mule Info and Error Logs via Log4J2 Configuration

In this article, I will explain how to separate the Mule application info and error logs into a separate log file. For instance, we have a Mule application that runs every 10 seconds to read an input file located on the local path /appdata/temp/input/persons.csv.

LOG4J2.XML Configuration

To separate the Mule INFO and ERROR logs, we need to define 2 separate RollingRandomAccessFile tags under Appenders in our log4j2.xml file located in src/main/resources. One for INFO logs and another for ERROR logsWe can set the filename of the log file as well as the log category (INFO, ERROR, WARN, DEBUG) that the file should contain which can be configured using ThresholdFilter Level. Lastly, we need to add the two RollingRandonAccessFile configuration to the loggers tag under AsyncRoot.



from DZone.com Feed https://ift.tt/2LIx5MS

No comments:

Post a Comment