Log color in Spring Boot
3 minute
Written by Nilesh Parab on
Yes that’s right! Staring at the bland plain logs is monotonous & cumbersome. It was & is painful to always figure out the warnings & errors out of logs.
While in Oracle Commerce (ATG) we used to have a special program the LogColorizer
to color the console output making it easy for us to figure out error (colored red) & warnings (colored yellow).
Way to colors
Now with Spring I started missing it until I discovered that in their documentation.
Just follow these 2 steps:
- In your
application.properties
add below configuration:# default value is DETECT spring.output.ansi.enabled=ALWAYS
- In your terminal set the environment variable to enable ANSI output:
export CLICOLOR=1
Now start you application to see the new look:
That’s all. Thanks. Please feel free suggest me any edits or help you need.