use of ch.qos.logback.classic.Logger in project netty by netty.
the class SingleThreadEventLoopTest method testRegistrationAfterShutdown.
@Test(timeout = 10000)
@SuppressWarnings("deprecation")
public void testRegistrationAfterShutdown() throws Exception {
loopA.shutdown();
// Disable logging temporarily.
Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
List<Appender<ILoggingEvent>> appenders = new ArrayList<Appender<ILoggingEvent>>();
for (Iterator<Appender<ILoggingEvent>> i = root.iteratorForAppenders(); i.hasNext(); ) {
Appender<ILoggingEvent> a = i.next();
appenders.add(a);
root.detachAppender(a);
}
try {
ChannelFuture f = loopA.register(new LocalChannel());
f.awaitUninterruptibly();
assertFalse(f.isSuccess());
assertThat(f.cause(), is(instanceOf(RejectedExecutionException.class)));
assertFalse(f.channel().isOpen());
} finally {
for (Appender<ILoggingEvent> a : appenders) {
root.addAppender(a);
}
}
}
use of ch.qos.logback.classic.Logger in project platformlayer by platformlayer.
the class LogbackHook method attachToRootLogger.
public static void attachToRootLogger() {
LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
LogbackHook appender = new LogbackHook();
// PatternLayoutEncoder encoder = new PatternLayoutEncoder();
// encoder.setContext(loggerContext);
// encoder.setPattern("%-4relative [%thread] %-5level %logger{35} - %msg%n");
// encoder.start();
// appender.setLayout(new PatternLayout("%d [%t] %-5p %c %x - %m%n"));
appender.start();
Logger logbackLogger = loggerContext.getLogger(Logger.ROOT_LOGGER_NAME);
logbackLogger.addAppender(appender);
}
use of ch.qos.logback.classic.Logger in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method clear.
@Before
public void clear() {
storage.clear();
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
when(mockAppender.getName()).thenReturn(CassandraSpanConsumerTest.class.getName());
root.addAppender(mockAppender);
}
use of ch.qos.logback.classic.Logger in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method tearDown.
@After
public void tearDown() {
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
root.detachAppender(mockAppender);
}
use of ch.qos.logback.classic.Logger in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method tearDown.
@After
public void tearDown() {
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
root.detachAppender(mockAppender);
}
Aggregations