Author: Aleksey Korelyakov

How to color logs in Logback

Very useful trick, that can make your logs more readable, especially in console. In Logback config file (in my project its logback.xml) you have to enclose the required template in parentheses and add a color indication in front of it in the format “% cyan (…)”. Here is an example for the console log output appender: