use of org.graylog2.syslog4j.SyslogConfigIF in project opennms by OpenNMS.
the class SyslogUtils method createNorthboundInstance.
/**
* Creates the northbound instance.
*
* @param destination the destination
* @throws SyslogRuntimeException the syslog runtime exception
*/
public static void createNorthboundInstance(SyslogDestination destination) throws SyslogRuntimeException {
LOG.info("Creating Syslog Northbound Instance {}", destination.getName());
int facility = convertFacility(destination.getFacility());
SyslogProtocol protocol = destination.getProtocol();
SyslogConfigIF instanceConfiguration = createConfig(destination, protocol, facility);
instanceConfiguration.setIdent("OpenNMS");
instanceConfiguration.setCharSet(destination.getCharSet());
instanceConfiguration.setMaxMessageLength(destination.getMaxMessageLength());
instanceConfiguration.setSendLocalName(destination.isSendLocalName());
instanceConfiguration.setSendLocalTimestamp(destination.isSendLocalTime());
instanceConfiguration.setTruncateMessage(destination.isTruncateMessage());
instanceConfiguration.setUseStructuredData(SyslogConstants.USE_STRUCTURED_DATA_DEFAULT);
try {
Syslog.createInstance(destination.getName(), instanceConfiguration);
} catch (SyslogRuntimeException e) {
LOG.error("Could not create northbound instance, '{}': {}", destination.getName(), e);
throw e;
}
}
Aggregations