Slf4j LoggerFactory.getLogger and sonarqube

前端 未结 1 1550
春和景丽
春和景丽 2021-01-07 01:20

What is the correct way to initialize Slf4j LoggerFactory.getLogger? I have in my code

static final Logger logger = LoggerFactory.getLogger(MyClass.class);         


        
相关标签:
1条回答
  • 2021-01-07 01:50

    Constants (static final) variables are generally in upper case in Java. So you can either:

    • ignore the comment in this particular case (it is not unusual to use small caps for the logger)
    • rename logger into something else, for example LOG
    0 讨论(0)
提交回复
热议问题