use of org.apache.logging.log4j.core.net.AbstractSocketManager in project logging-log4j2 by apache.
the class SyslogAppenderConfigurationTest method checkProtocol.
private void checkProtocol(final Protocol expected, final Configuration configuration) {
final Map<String, Appender> appenders = configuration.getAppenders();
assertNotNull(appenders);
final String appenderName = "syslog";
final Appender appender = appenders.get(appenderName);
assertNotNull(appender, "Missing appender " + appenderName);
final SocketAppender socketAppender = (SocketAppender) appender;
@SuppressWarnings("resource") final AbstractSocketManager manager = socketAppender.getManager();
final String prefix = expected + ":";
assertTrue(manager.getName().startsWith(prefix), () -> String.format("'%s' does not start with '%s'", manager.getName(), prefix));
}
Aggregations