I do not think this is possible because the registrar does not know anything about classes and inheritance. The registrar name is a simple text name, such as "abcd". Perhaps you could use a subclass class in a superclass, i.e. Instead:
private static Logger logger = Logger.getLogger(SuperClass.class);
using:
private Logger logger = Logger.getLogger(getClass());
or you can use both:
private Logger subLogger = Logger.getLogger(getClass()); private static Logger logger = Logger.getLogger(SuperClass.class);
and then you can use more complex logic:
if(logger.isInfoEnabled() || subLogger.isInfoEnabled()) { ... }
But if I were you, I would not use this magic, because registration should be as simple as possible (but not simple).
source share