private LogDestination getLogbackLogDestination(ClassLoader cl, Application application, boolean root, String logName, String appenderName) {
LogbackFactoryAccessor manager = LogbackFactoryAccessor.create(cl);
if (manager != null) {
manager.setApplication(application);
LogbackLoggerAccessor log = (root ? manager.getRootLogger() : manager.getLogger(logName));
if (log != null) {
return log.getAppender(appenderName);
}
}
return null;
}