Logstash

The Logstash project from Elastic provides for a centralized server to accumulate logs from a multitude of applications. WildFly Swarm makes it easy to have each of your applications or services dump their logs into it.

Configure

Dependency

To add Logstash integration to your WildFly Swarm application, you need to add a dependency:

<dependency>
  <groupId>org.wildfly.swarm</groupId>
  <artifactId>logstash</artifactId>
</dependency>

Configuration

While the above dependency adds the capability of logging to Logstash, until the Logstash server’s hostname and port is set, the integration remains inactive.

To configure where the Logstash server is running, the following two properties need to be set, either through plugin configuration or on the command-line using -D…​

Name Description

swarm.logstash.hostname

The hostname of the Logstash server

swarm.logstash.port

The port of the Logstash server