@Override
public String apply(LoggingEvent loggingEvent) {
return loggingEvent.getRenderedMessage();
}
});
Appender appender = new AppenderSkeleton(true) {
@Override
protected void append(LoggingEvent event) {
if (event.getLevel().equals(Level.ERROR)) {
events.add(event);
}
}
@Override
public void close() {
}
@Override
public boolean requiresLayout() {
return false;
}
};
appender.setLayout(new SimpleLayout());
Logger logger = Logger.getLogger("org.apache.curator");
logger.addAppender(appender);
// Check that we can intercept error log messages from the client
CuratorFramework clientTestLogSetup = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));