The most commonly used spring logging pattern is:
spring logging

clr means color. The following colors are supported:

  1. blue
  2. cyan
  3. faint
  4. green

When a file in the classpath has one of the following names, Spring Boot will automatically load it over the default configuration:

  1. logback-spring.xml
  2. logback.xml
  3. logback-spring.groovy
  4. logback.groovy

MDC:

We can create a filter which will generate a random UUID and can be passed in every request. This will help in tracking the flow

Sample logback-spring.xml file:

Leave a Reply

Your email address will not be published. Required fields are marked *