@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

It is possible to use sqlcmd to update the logging configuration. However, the argument is interpreted as raw XML content rather than as a file specification. Consequently, it can be difficult to use interactively. But you can write the file contents to an input file and then pipe that to sqlcmd, like so:

$ echo "exec @UpdateLogging '" > sqlcmd.input
$ cat mylog4j.xml >> sqlcmd.input
$ echo "';" >> sqlcmd.input
$ cat sqlcmd.input | sqlcmd

The following program example demonstrates another way to update the logging, using the contents of an XML file (identified by the string xmlfilename).

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