I've tried to change the config file to like below but still, the output is plain white. How can I change it to any color? Like different color for each level.
Code:
import org.apache.log4j.*;
public class StartUp {
private static final Logger LOGGER = Logger.getLogger(Class.class.getName());
public static void main(String[] args) throws Exception {
LOGGER.trace("Trace Message!");
LOGGER.debug("Debug Message!");
LOGGER.info("Info Message!");
LOGGER.warn("Warn Message!");
LOGGER.error("Error Message!");
LOGGER.fatal("Fatal Message!");
Config file (log4j2.xml):
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="CONSOLE" target="SYSTEM_OUT">
<PatternLayout pattern="%highlight{[%d] - %msg%n}{FATAL=red blink, ERROR=red, WARN=yellow bold, INFO=black, DEBUG=green bold, TRACE=blue}"/>
</Console>
</Appenders>
<Loggers>
<Root level="ALL">
<AppenderRef ref="CONSOLE"/>
</Root>
</Loggers>
</Configuration>