Notes @ Slf4j use

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;

 

 
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;

 

 
Class above using annotation @ Sl4j

Guess you like

Origin www.cnblogs.com/gjack/p/11617972.html