java - Pmd error regarding logger -
i have line in code:
private transient final logger logger = loggerfactory.getlogger(getclass());
i build project , pmd check tells me that:
the logger variable declaration not contain static , final modifiers.
what can fix this? tried putting static modifier comes error:
cannot make static reference non-static method getclass() type object
if using in main make static
and use logger this
private static final logger log = logger.getlogger(main.class.getsimplename());
Comments
Post a Comment