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.
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.
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
Logger | Description |
---|---|
ADHOC | Execution of ad hoc queries |
AGREEMENT | Establishing and maintaining the cluster mesh |
AUTH | Authentication and authorization of clients |
COMPILER | Interpretation of SQL in ad hoc queries |
CONSOLE | Informational messages intended for display on the console |
DR | Database replication sending data |
DRAGENT | Database replication receiving data |
EXPORT | Exporting data |
GC | Java garbage collection |
HOST | Host specific events |
IMPORT | Importing data |
ELASTIC | Elastic addition of nodes to the cluster |
JOINER | Host communication between nodes |
LICENSE | Licensing |
LOADER | Bulk loading of data (including as part of import) |
MP | Transaction management for multi-partition transactions, see also TM |
NETWORK | Network events related to the database cluster |
RECOVERY | Node recovery and rejoin, with a focus on recovery |
REJOIN | Node recovery and rejoin, with a focus on rejoin |
SNAPSHOT | Snapshot activity |
SQL | Execution of SQL statements |
SSM | State machine management via zookeeper |
TM | Transaction management for partitioned transactions, see also MP |
TOPICS | Streaming data in topics |
TOPOLOGY | Cluster topology including placement groups and partition layout |
UDF | User-defined functions |