First of all I will give a brief explanation about the scenario. In my application I am using SLF4J as the logging facade. For logging, I am using Log4j2 and I have my customized log4j2.xml as well.
When I log in my classes, I create a logger as mentioned below:
private static final Logger LOG = LogManager.getLogger(TestController.class);
Later, I found out that there is a @Slf4j annotation and then I can log without creating a logger instance manually.
log.info("Info log in getHello() in TestController");
I did a minor research about the topic where is there any drawbacks of using @Slf4j annotation, instead of creating a logger instance within the class. I did not come across any reason why shouldn't use @Slf4j annotation.
However, before proceeding I wanted to ask from this community to confirm is there any drawback of using @Slf4j?