Lombok will provide log variable when you use @slf4j annotation on class level. We're changing the name as logger. The above logging configuration is sufficient for development. Overview. You can check here and here For the purpose of this blog post, we will also include … id 'java'. If you want to use SLF4J+Log4j2 in a Spring application, then you’ll have to exclude the spring-boot-starter-logging dependency and replace it for the spring-boot-starter-log4j2 one. The latest version is located on Maven Central. 4. logback.xml. This kind of approach allows choosing the logging framework such as Log4j 2 or Loback during compilation just by using a different library that uses the SLF4J API.