[18.0.0.1 and later]

Analyzing Liberty messages in IBM Cloud Private

In IBM Cloud Private, when you run Liberty with JSON format logging in the console, log events can be broken down into fields and stored in Elasticsearch. You can use Kibana to monitor multiple Liberty pods with dashboards and search, or you can filter a large number of log records with queries.

About this task

A Kubernetes deployment is composed of pods, which are composed of containers. In IBM Cloud Private, the console output of each pod is forwarded to the built-in elastic logging stack automatically. For more information about elastic logging, see IBM Cloud Private logging .

Procedure

Complete this task to browse the IBM Cloud Private catalog and select the appropriate Helm chart, which you use to deploy applications.

  1. Enable JSON logging in your Helm chart.
    1. From the IBM Cloud Private console, click Menu > Catalog.
    2. Select ibm-websphere-liberty Helm chart [1.4.0+]*, in the Logs section.
      Note: If your Helm catalog does not contain this Helm chart when you access the console, select Manage > Helm Repositories, and click the button to sync repositories to refresh the catalog.
    3. Set the Logging fields to the following default values:
      Table 1. Helm chart fields and values for JSON logging
      GUI Field Name Command-Line Field Name Field Value
      Console logging format logs.consoleFormat json
      Console logging level logs.consoleLogLevel info
      Console logging source logs.consoleSource message,trace,accessLog,ffdc

      The following source types are supported: messages, traces, access log records, and FFDC. Specify each source type in a comma-separated list in the console logging source. Using access log requires addition settings in server.xml file. For more information, see HTTP access logging.

    Alternatively, you can set the previous values when you deploy the Liberty Helm chart from the command line by using the --set flag.
  2. Deploy Kibana. After you deploy Liberty with JSON logging enabled, log records are stored in Elasticsearch, and you can view the log records with Kibana.
    1. To deploy Kibana, from the console, click Catalog > Helm Charts.
    2. Select the ibm-icplogging-kibana Helm chart, and click kube-system in the Target namespace.
    3. Click Install.
  3. Open Kibana.
    1. Click Network Access > Services from the console.
    2. Select Kibana from the list of services.
    3. Click the link in the Node port field to open Kibana.
  4. Create an index pattern in Kibana.
    1. From Kibana, click Management > Index Patterns. Type logstash-* for the Index name or Pattern.
    2. Select ibm_datetime as the Time Filter field name.
    3. Click Create.
    Now, you can create your own queries, visualizations, or dashboards to analyze the log data.

What to do next

You can also download a set of sample dashboards from https://github.com/WASdev/sample.dashboards. To import dashboards into Kibana, select Management > Saved Objects, click Import.


Icon that indicates the type of topic Task topic

File name: twlp_icp_json_logging.html