
Questions: 23,720 //
Answers: 52,287 //
Contributing Members: 17,987
Hi, I want to change the log pattern in Anypoint Studio console. My current log pattern is:
"%-5p %d{dd MMM yyyy HH:mm:ss,SSS} [%t] %c: %m%n"
which I get:
"INFO 2016-02-26 14:21:03,002 [[main].manage-file.stage1.01] org.mule.api.processor.LoggerMessageProcessor: Start process"
I changed the log4j2.xml and log4j.properties file but it only make change on the log file mule_ee.log. How can I change the log display to the new pattern on Anypoint studio console? ,Hi, I want to change the log pattern in Anypoint Studio console. My current log pattern is:
"%-5p %d{dd MMM yyyy HH:mm:ss,SSS} [%t] %c: %m%n"
which I get:
"INFO 2016-02-26 14:21:03,002 [[main].manage-file.stage1.01] org.mule.api.processor.LoggerMessageProcessor: Start process"
I changed the log4j2.xml and log4j.properties file but it only make change on the log file mule_ee.log. How can I change the log display to the new pattern on Anypoint studio console?
May 30, 2018 at 04:58 AM, vaughnbutt answered with:
Hi Antoine,
It's not obvious and YMMV but what I do to use my own pattern when I run an app in Anypoint Studio is add a console appender to src/main/resources/log4j2.xml as below:
<Appenders>
<RollingFile name="file"
... snipped ...
</RollingFile>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%-5p %d{HH:mm:ss,SSS} %50logger{1.}: %message%n"/>
</Console>
</Appenders>
And:
<AsyncRoot level="INFO">
<AppenderRef ref="file" />
<AppenderRef ref="Console"/>
</AsyncRoot>
Vaughn Butt, Integration Works NZ