if (layout instanceof PatternLayout) {
appenderData.setPattern(((PatternLayout) layout).getConversionPattern());
}
if (targetAppender instanceof AppenderSkeleton) { // normally all the appenders inherit from AppenderSkelton
AppenderSkeleton appender = (AppenderSkeleton) targetAppender;
Priority priority = appender.getThreshold();
if (priority != null) {
appenderData.setThreshold(priority.toString());
} else {
appender.setThreshold(Level.toLevel(Priority.DEBUG_INT));
appenderData.setThreshold("DEBUG");
}
}