Send Open Liberty logs to Elastic Stack

Learn how to use the Elastic Stack to analyze your Open Liberty logs, trace, FFDC (first failure data capture), audit events, and access logs. Learn, also, how to use Kibana dashboards to visualize real-time information at a glance.

Example JSON logging configuration in bootstrap.properties file

com.ibm.ws.logging.console.format=json
com.ibm.ws.logging.console.log.level=info
com.ibm.ws.logging.console.source=message,trace,accessLog,ffdc,audit

com.ibm.ws.logging.message.format=json
com.ibm.ws.logging.message.source=message,trace,accessLog,ffdc,audit

com.ibm.ws.logging.trace.file.name=stdout

Logstash collector

Normally, you use JSON logging in Open Liberty and send the log events data to Elastic Stack for log aggregation. If you can’t install Filebeat on your Liberty node, see how you can use Liberty’s Logstash collector feature to send logs to your Elastic Stack.

In cases where you need logstashCollector, add the following to your server.xml:

<featureManager>
    <feature>logstashCollector-1.0</feature>
</featureManager>

<keyStoreid="defaultKeyStore" password="Liberty" />
<sslid="mySSLConfig"trustStoreRef="defaultKeyStore"keyStoreRef="defaultKeyStore" />

<logstashCollector
    source="message, trace, ffdc,garbageCollection,accessLogs, audit"
    host="myhost.acme.com"
    port="9091"
    sslRef="mySSLConfig"
    maxFieldLength="5000”             <<< Adjust, if needed, to avoid message truncation
    <tag>toronto</tag>                <<< tags are included in all events from this server
    <tag>coreBanking</tag>
/>