What is default CONSOLE_LOG_PATTERN used for Spring Boot logging and where to find it?
Solution 1:
I have just found out this configuration is available at the DefaultLogbackConfiguration
file under Spring Boot project:
private static final String CONSOLE_LOG_PATTERN = "%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} "
+ "%clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} "
+ "%clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} "
+ "%clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}";
To find the pattern for a certain Spring Boot version, either:
- Browse the source file available at GitHub: Spring Boot 2.3.x
- In IntelliJ Idea press 2x Left Shift and fulltext search for
DefaultLogbackConfiguration
The source of my finding is https://www.logicbig.com/tutorials/spring-framework/spring-boot/logging-console-pattern.html.