The goal is to be reasonably performant and (near) garbage-free.
The layout lacks many options, but the defaults should produce sane messages conforming to the Logback LoggingEvent fields. Each message is separated by a newline.
The layout is modelled after GelfLayout.
For printing to standard out in a format suitable for eg. fluentd:
<Appenders>
<Console name="console" target="SYSTEM_OUT">
<LogstashLayoutV1 host="someserver" includeStacktrace="true" includeThreadContext="false"/>
</Console>
</Appenders>
Supported parameters are:
host
: The hostname, appears in thesource_host
field. Optional, defaults to the local hostname.includeStacktrace
: Enable logging of stacktraces of logged exceptions. Optional, defaults totrue
.includeThreadContext
: Enable logging of the thread context. Optional, defaults totrue
.includeTimestamp
: Enable logging of the@timestamp
field. Optional, defaults totrue
.