This library contains a log4j2 layout to format log lines according to the logstash JSON spec.
Include in your project as follows:
<dependencies>
<dependency>
<groupId>io.github.alexswilliams</groupId>
<artifactId>logstash-log4j2-encoder</artifactId>
</dependency>
</dependencies>
The minimum supported JDK is 1.8.