How to Enable Color in Spring Boot Console Log

Spring boot supports color coding of logging output displayed on the console. This enables us to quickly identify any errors or warnings logged by spring boot system. On most systems color coding works automatically. However if you are using a Mac terminal, you will find that no color coding is applied to the spring boot console log output. Mac terminal does have support for color, but somehow spring boot is unable to detect it.

spring-boot-console-log-without-color

The solution is simple. Just add the following property in the application.properties located in src/main/resources folder of your spring boot project. The default value for the following attribute is "detect".

spring.output.ansi.enabled=always

Run the application again. Voila! Now you have the color coding enabled on your spring boot application console log.

spring-boot-console-log-with-color

Do you have a programming problem that you are unable to solve? Please send us your problem and we will publish the solution! Please email us.

Leave a Reply