Can anybody help me with @Slf4j annotation in Lombok?
I prefer to log something in my SpringBoot app. For this I want to use @Slf4j annotation from Lombok. I installed Lombok plugin in my IntelliJ IDEA, turn on 'Annotation processing', add @Slf4j annotation to my class and add lombok dependency to my pom.xml file. Now I can find object 'log' in the class, but I can't apply any log methods to it (like error(), debug(), info(), etc.). Why aren't these methods found?
IntelliJ IDEA Community 2020.3
Lombok plugin bundled 203.7717.56
lombok 1.18.6
dependency in pom.xml:
<properties>
<lombok.version>1.18.6</lombok.version>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
</dependencies>
logging in my class:
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@RequiredArgsConstructor
@Service
public class ImportServiceImpl implements ImportService {
...
public void importData() {
log.info("some log");
}
...
}