try {
Object contextLogger = getContainerWrapper().getTomcatContainer().getLogger(ctx);
if (contextLogger != null) {
if (contextLogger.getClass().getName().startsWith("org.apache.commons.logging")) {
CommonsLoggerAccessor commonsAccessor = new CommonsLoggerAccessor();
commonsAccessor.setTarget(contextLogger);
commonsAccessor.setApplication(application);
allAppenders.addAll(commonsAccessor.getDestinations());
} else if (contextLogger.getClass().getName().startsWith("org.apache.catalina.logger")) {
CatalinaLoggerAccessor catalinaAccessor = new CatalinaLoggerAccessor();
catalinaAccessor.setApplication(application);
catalinaAccessor.setTarget(contextLogger);
allAppenders.add(catalinaAccessor);