Should a “static final Logger” be declared in UPPER-CASE?

In Java, static final variables are constants and the convention is that they should be in upper-case. However, I have seen that most people declare loggers in lower-case which comes up as a violation in PMD.

e.g:

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

Just search googleor SO for “static final logger” and you will see this for yourself.

Should we be using LOGGER instead?

11 Answers
11

Leave a Comment