@UpdateLogging

Documentation

VoltDB Home » Documentation » Using VoltDB

@UpdateLogging

@UpdateLogging — Changes the logging configuration for a running database.

Synopsis

@UpdateLogging String configuration

Description

The @UpdateLogging system procedure lets you change the logging configuration for VoltDB. The argument, configuration, is a text string containing the Log4J XML configuration definition. Calling @UpdateLogging updates the logging configuration for the entire cluster and can include multiple modifications. If you just want to change the logging level of a single component, you can use the @AdjustLogging system procedure or its corresponding voltadmin log4j command.

Return Values

Returns one VoltTable with one row.

NameDatatypeDescription
STATUSBIGINTAlways returns the value zero (0) indicating success.

Examples

From the command line, the recommended way to update the Log4J configuration is to use the voltadmin log4j command, specifying the location of an updated configuration file. For example:

$ voltadmin log4j mylog4j.xml

The following program example demonstrates another way to update the logging, using the system procedure and passing the contents of an XML file as the argument:

try {
    Scanner scan = new Scanner(new File(xmlfilename));  
    scan.useDelimiter("\\Z");  
    String content = scan.next(); 
    client.callProcedureSync("@UpdateLogging",content);
}
catch (Exception e) {
    e.printStackTrace();
}