1 2 class Foo { 3 private final Log log = LogFactory.getLog(getClass()); 4 }
Compare to the following where the class name is refered to explicitely. If the class is renamed or parts of the codes are copied ("reused") the logging will by misleading.
1 2 class Foo { 3 private static final Log log = LogFactory.getLog(Foo.class); 4 }