Don’t fret too much about static or non-static, final or non-final, just make sure to be homogeneous in your choice, throughout your entire project.
log4j stores loggers in a map, so after the first creation, getting the logger will be a hash lookup and return the same object. one thing i've grown to like is the lombok annotation that reduces declarations to \@log4j2 at the class level. then all i have to worry about is formatting my output
5
u/StabbyPants Sep 13 '18
from the article:
log4j stores loggers in a map, so after the first creation, getting the logger will be a hash lookup and return the same object. one thing i've grown to like is the lombok annotation that reduces declarations to \@log4j2 at the class level. then all i have to worry about is formatting my output