use of ch.qos.logback.classic.sift.SiftingAppender in project qpid-broker-j by apache.
the class QpidBrokerTestCase method getFileFromSiftingAppender.
private File getFileFromSiftingAppender(final ch.qos.logback.classic.Logger logger) {
String key = logger.getLoggerContext().getProperty(LogbackPropertyValueDiscriminator.CLASS_QUALIFIED_TEST_NAME);
for (Iterator<Appender<ILoggingEvent>> index = logger.iteratorForAppenders(); index.hasNext(); ) /* do nothing */
{
Appender<ILoggingEvent> appender = index.next();
if (appender instanceof SiftingAppender) {
SiftingAppender siftingAppender = (SiftingAppender) appender;
Appender subAppender = siftingAppender.getAppenderTracker().find(key);
if (subAppender instanceof FileAppender) {
return new File(((FileAppender) subAppender).getFile());
}
}
}
return null;
}
Aggregations