I am looking for a "self" reference to the current class in JAVA in a static context manner like in PHP Scope Resolution Operator?
Solution: Break out of scope? BEWARE, this is compared to a static definition really slow (by factor 300):
static Logger LOG = LoggerFactory.getLogger(new RuntimeException().getStackTrace()[0].getClassName());
The old-fashioned way would be:
static Logger LOG = LoggerFactory.getLogger(<Classname>.class.getName());
Are there any alternatives? I'm looking for a way to put the logger definition in an abstract class. The logger should determine the class it's being called from by itself.