@UpdateLogging

Documentation

VoltDB Home » Documentation » Using VoltDB

@UpdateLogging

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

Synopsis

@UpdateLogging CString configuration

Description

The @UpdateLogging system procedure lets you change the logging configuration for VoltDB. The second argument, configuration, is a text string containing the Log4J XML configuration definition.

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();
}