Disclaimer: If you do not want to write every private final Logger logger = LoggerFactory.getLogger (current class name .class); you can use an annotation @ Slf4j;
1. Lombok idea first need to install plug;
![](https://upload-images.jianshu.io/upload_images/4724335-4c1a35e17649e190.png?imageMogr2/auto-orient/strip|imageView2/2/w/1200/format/webp)
Plug-in installed lombok
2. Add rely lombok in the pom file
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<Version> 1.16.16 </ version> <-! A version of their own choice on the line ->
</dependency>
3. Add the above @ Sl4j class notes, and then use the log print log;
![](https://upload-images.jianshu.io/upload_images/4724335-f1e94ef00d64bec5.png?imageMogr2/auto-orient/strip|imageView2/2/w/1002/format/webp)
Class above using annotation @ Sl4j