I think the crux of the problem here is that you're trying to use the logging framework for something other than logging...
Logging is meant to push information relevant to a developer to a persistent store in order to help them diagnose issues.
A developer has no need for an ability to dynamically add loggers to the logging system, they are always statically defined and rarely (if ever) changed.
But if you're trying to use the logging framework for some other purpose (i.e. some sort of crazy auditing scheme), then I think what you're doing is trying to pound a square peg into a round hole...
However, since you seem totally set on this, the answer for your problem is to use reflection on the LogFactoryUtil class:
1
2Field logFactory = LogFactoryUtil.class.getDeclaredField("_logFactory");
3
4logFactory.setAccessible(true);
5
6LogFactory liferayLogFactory = (LogFactory) logFactory.get(null);
From here you can test to see if it is the Log4jLogFactoryImpl that you're looking for.
Since the liferayLogFactory class is actually in another class loader, you may not be able to cast and use it directly. You may need to use reflection exclusively to invoke methods on the returned value of logFactory.get(null) instead of trying to cast it to some type in your own class loader.