I will share my opinion. I would say that this is so that you should not worry in terms of performance. There are probably parts in the code that can be optimized much more than this thing :)
Now about your question. Check out the LoggerFactory code
Note that it getLogger(Class<?> name)simply calls the overloaded method:
Logger logger = getLogger(clazz.getName());
And does some extra calculations. So the method with the string is obviously a little faster.
Logger , :
public class SomeClass {
private static final Logger LOG = LoggerFactory.getLogger(SomeClass.class);
}
this.getClass(), this ( ).
ClassName.getClass() , . , .
, , 3 .
, "DB" , -, database.log, .
, :
public class SomeClass {
private static final Logger LOG = LoggerFactory.getLogger("DB");
}
,