use of io.dropwizard.logging.async.AsyncLoggingEventAppenderFactory in project dropwizard by dropwizard.
the class ConsoleAppenderFactoryTest method defaultIsNotNeverBlock.
@Test
public void defaultIsNotNeverBlock() throws Exception {
ConsoleAppenderFactory<ILoggingEvent> consoleAppenderFactory = new ConsoleAppenderFactory<>();
// default neverBlock
AsyncAppender asyncAppender = (AsyncAppender) consoleAppenderFactory.build(new LoggerContext(), "test", new DropwizardLayoutFactory(), new NullLevelFilterFactory<>(), new AsyncLoggingEventAppenderFactory());
assertThat(asyncAppender.isNeverBlock()).isFalse();
}
use of io.dropwizard.logging.async.AsyncLoggingEventAppenderFactory in project dropwizard by dropwizard.
the class ConsoleAppenderFactoryTest method isNotNeverBlock.
@Test
public void isNotNeverBlock() throws Exception {
ConsoleAppenderFactory<ILoggingEvent> consoleAppenderFactory = new ConsoleAppenderFactory<>();
consoleAppenderFactory.setNeverBlock(false);
AsyncAppender asyncAppender = (AsyncAppender) consoleAppenderFactory.build(new LoggerContext(), "test", new DropwizardLayoutFactory(), new NullLevelFilterFactory<>(), new AsyncLoggingEventAppenderFactory());
assertThat(asyncAppender.isNeverBlock()).isFalse();
}
use of io.dropwizard.logging.async.AsyncLoggingEventAppenderFactory in project dropwizard by dropwizard.
the class ConsoleAppenderFactoryTest method appenderContextIsSet.
@Test
public void appenderContextIsSet() throws Exception {
final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
final ConsoleAppenderFactory<ILoggingEvent> appenderFactory = new ConsoleAppenderFactory<>();
final Appender<ILoggingEvent> appender = appenderFactory.build(root.getLoggerContext(), "test", new DropwizardLayoutFactory(), new NullLevelFilterFactory<>(), new AsyncLoggingEventAppenderFactory());
assertThat(appender.getContext()).isEqualTo(root.getLoggerContext());
}
use of io.dropwizard.logging.async.AsyncLoggingEventAppenderFactory in project dropwizard by dropwizard.
the class FileAppenderFactoryTest method appenderContextIsSet.
@Test
public void appenderContextIsSet() throws Exception {
final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
final FileAppenderFactory<ILoggingEvent> appenderFactory = new FileAppenderFactory<>();
appenderFactory.setArchivedLogFilenamePattern(folder.newFile("example-%d.log.gz").toString());
final Appender<ILoggingEvent> appender = appenderFactory.build(root.getLoggerContext(), "test", new DropwizardLayoutFactory(), new NullLevelFilterFactory<>(), new AsyncLoggingEventAppenderFactory());
assertThat(appender.getContext()).isEqualTo(root.getLoggerContext());
}
use of io.dropwizard.logging.async.AsyncLoggingEventAppenderFactory in project dropwizard by dropwizard.
the class FileAppenderFactoryTest method appenderNameIsSet.
@Test
public void appenderNameIsSet() throws Exception {
final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
final FileAppenderFactory<ILoggingEvent> appenderFactory = new FileAppenderFactory<>();
appenderFactory.setArchivedLogFilenamePattern(folder.newFile("example-%d.log.gz").toString());
final Appender<ILoggingEvent> appender = appenderFactory.build(root.getLoggerContext(), "test", new DropwizardLayoutFactory(), new NullLevelFilterFactory<>(), new AsyncLoggingEventAppenderFactory());
assertThat(appender.getName()).isEqualTo("async-file-appender");
}
Aggregations