Search in sources :

Example 1 with GracefulShutdownHook

use of org.graylog2.system.shutdown.GracefulShutdownHook in project graylog2-server by Graylog2.

the class OutputSetupService method shutDownRunningOutputs.

private void shutDownRunningOutputs() {
    for (MessageOutput output : outputRegistry.getMessageOutputs()) {
        // Do not execute the stop() method for Outputs that implement the GracefulShutdown mechanism.
        if (output instanceof GracefulShutdownHook) {
            continue;
        }
        try {
            // TODO: change to debug
            LOG.info("Stopping output {}", output.getClass().getName());
            output.stop();
        } catch (Exception e) {
            LOG.error("Error stopping output", e);
        }
    }
}
Also used : MessageOutput(org.graylog2.plugin.outputs.MessageOutput) GracefulShutdownHook(org.graylog2.system.shutdown.GracefulShutdownHook)

Aggregations

MessageOutput (org.graylog2.plugin.outputs.MessageOutput)1 GracefulShutdownHook (org.graylog2.system.shutdown.GracefulShutdownHook)1