6.2. Creating the Logging Configuration File

Documentation

VoltDB Home » Documentation » Administrator's Guide

6.2. Creating the Logging Configuration File

VoltDB ships with a default Log4J configuration file, log4j2/voltserver.properties, in the installation directory. VoltDB uses this file to configure logging and the default settings are recommended for most applications. However, if you wish to change the configuration, you can use the default Log4J file as a template or you can create a new file from scratch.

Note

The following instructions apply to VoltDB running on bare metal. For Kubernetes, VoltDB uses a different initial configuration that must be extracted from the Docker file first. See the section on "Configuring Logging" in the Volt Kubernetes Administrator's Guide for more information.

The following is an example of a modified Log4J configuration file. Based on the existing voltserver.properties, the customization adds the following changes to the end of the file:

  [ . . . ]

# Attach appenders to the root logger. All events are
# written to file, including DEBUG and above.
# Information, Warnings, and above are copied to the console.

rootLogger.level = DEBUG
rootLogger.appenderRef.1.ref = file
rootLogger.appenderRef.2.ref = console-filtered

# Adjust the logger for AUTH to include all messages
# from TRACE and above and write them to the log file.
# The console appenders filter out anything below INFO.

logger.auth.name = AUTH
logger.auth.level = TRACE
logger.auth.appenderRef.1.ref = file

The default Log4J configuration file includes appenders for the console and log file output. The customization listed above changes the logging level for the root logger from INFO to DEBUG. The console appender is defined to filter messages for INFO and above, while the file appender does not define any filters. This means that debug messages for all Volt components will be written to the log file, but only INFO and above will be written to the console.

In addition, a new logger, auth, is added to log TRACE messages for the AUTH component. In other words, all messages of severity DEBUG and above will be written to the log file, as well as TRACE and above for the AUTH component that tracks user authentication.

Note

This example is for demonstration purposes only. Normally, do not set the severity to either "debug" or "trace" for production systems unless instructed to by VoltDB Support. Trace and debug logging generates a significant number of messages that can negatively impact performance. They contain internal information for debugging purposes and provide no additional value otherwise.

The custom configuration file identifies a class of messages to log (in this case "AUTH"), as well as the severity ("trace"). VoltDB defines several different classes of messages you can log. Table 6.1, “VoltDB Components for Logging” lists the loggers you can invoke.

Table 6.1. VoltDB Components for Logging

LoggerDescription
ADHOCExecution of ad hoc queries
AGREEMENTEstablishing and maintaining the cluster mesh
AUTHAuthentication and authorization of clients
COMPILERInterpretation of SQL in ad hoc queries
CONSOLEInformational messages intended for display on the console
DRDatabase replication sending data
DRAGENTDatabase replication receiving data
EXPORTExporting data
GCJava garbage collection
HOSTHost specific events
IMPORTImporting data
ELASTICElastic addition of nodes to the cluster
JOINERHost communication between nodes
LICENSELicensing
LOADERBulk loading of data (including as part of import)
MPTransaction management for multi-partition transactions, see also TM
NETWORKNetwork events related to the database cluster
RECOVERYNode recovery and rejoin, with a focus on recovery
REJOINNode recovery and rejoin, with a focus on rejoin
SNAPSHOTSnapshot activity
SQLExecution of SQL statements
SSMState machine management via zookeeper
TMTransaction management for partitioned transactions, see also MP
TOPICSStreaming data in topics
TOPOLOGYCluster topology including placement groups and partition layout
UDFUser-defined functions