Getting Spring Boot color console logging working within Intellij?

Has anyone figured out how to get color output working within Intellij Idea for a Spring Boot application?


Solution 1:

Using a Mac, Intellij Idea 14 and Spring Boot v1.2.2.RELEASE, all you have to do is set:

spring.output.ansi.enabled=ALWAYS

I have added this as a VM option (-Dspring.output.ansi.enabled=ALWAYS). Works great!

Solution 2:

In application.properties use (for example) the following line:

logging.pattern.console= %d{yyyy-MMM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{15}) - %msg %n

If you would like almost similar to Spring Boot you can use pattern like this:

%date  %highlight(%-5level) [%12.12thread] %cyan(%-40.40logger{40}) : %msg %n