2.5. Configuring Logging

Documentation

VoltDB Home » Documentation » VoltDB Kubernetes Administrator's Guide

2.5. Configuring Logging

VoltDB uses Log4J for logging messages while the database is running. The chapter on '"Logging and Analyzing Activity in a VoltDB Database" in the VoltDB Administrator's Guide describes some of the ways you can customize the logging to meet your needs, including changing the logging level or adding appenders. Logging is also available in the Kubernetes environment and is configured using a Log4J XML configuration file. However, the default configuration and how you set the configuration when starting or updating the database in Kubernetes is different than as described in the Administrator's Guide.

Before you attempt to customize the logging, you should familiarize yourself with the default settings. The easiest way to do this is to extract a copy of the default configuration from the Docker image you will be using. The following commands create a docker container without actually starting the image, extract the configuration file to a local file (k8s-log4j.xml in the example), then delete the container.

$ ID=$(docker create voltdb/voltdb-enterprise)
$ docker cp ${ID}:/opt/voltdb/tools/kubernetes/server-log4j.xml k8s-log4j.xml
$ docker rm $ID

Once you extract the default configuration and made the changes you want, you are ready to specify your new configuration on the Helm command to start the database. You do this by setting the cluster.config.log4jcfgFile property. For example:

$ helm install mydb voltdb/voltdb                       \
   --values myconfig.yaml                               \
   --set cluster.clusterSpec.replicas=5                 \
   --set-file cluster.config.licenseXMLFile=license.xml \
   --set-file cluster.config.log4jcfgFile=my-log4j.xml

Similarly, you can update the logging configuration on a running cluster by using the --set-file argument on the Helm upgrade command:

$ helm upgrade mydb voltdb/voltdb --reuse-values       \
   --set-file cluster.config.log4jcfgFile=my-log4j.xml