I am new for log4j2.I want to print logs in different colors for different levels.I am using eclipse ide for development java with log4j2 for application logging. This is my log4j2.xml file
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level %logger{36}.%M() @%L - %msg%n}{FATAL=red, ERROR=red, WARN=yellow, INFO=black, DEBUG=green, TRACE=blue}"/>
</Console>
</Appenders>
<loggers>
<Logger name="org.apache.log4j.xml" level="all"/>
<root level="all">
<appender-ref ref="STDOUT"/>
</root>
</loggers>
</Configuration>
when i am execute the log4j2 example I am getting below result in eclipse console.
[32m15:56:30.536 DEBUG com.syn.test.Test.main() @15 - this is debug message
[m[32m15:56:30.539 DEBUG com.syn.test.Test.main() @19 - this is debug messge
[m
now my question is how to print logs in different colors for different levels in eclipse console.