Reports the logger fields on classes that are not declared static and final. Ensuring that every class logger is effectively constant and bound to that class simplifies the task of providing a unified logging implementation for an application. Interfaces, enumerations, annotations, and inner classes are not reported by this inspection.

A quick-fix is provided to change the logger modifiers to static final.

Example:


  public class Significant {
    private Logger LOG = Logger.getLogger(Critical.class);
  }

After the quick-fix is applied:


  public class Significant {
    private static final Logger LOG = Logger.getLogger(Critical.class);
  }

Configure the inspection: