About Dynamic Logging

Dynamic logging can be streamed using the NuoDB Command subcommand nuocmd show log-messages. In the example below, the logging category sql-statements is enabled to emit information about SQL statements being executed. Assume that the following simple SQL statement was executed while the nuocmd show log-messages command below was running:

select getnodeid() from dual;

This would generate following logging on the nuocmd show log-messages invocation:

$ nuocmd show log-messages --db-name test --log-options sql-statements
...
2021-02-19T20:46:21.331: [TE] server1:48006 [start_id = 7] [pid = 148] [node_id = 3] MONITORED:RUNNING =>[debug,sql-statements] [4,4197123,DB,USER]:select tableName,tableId,currentVersion,schema,viewDefinition,cardinality,subtype,extends, optional_field(recordsbatchfactor,0),optional_field(objectid,0),optional_field(indexFormatVersion,0), optional_field(_RECORD_ID,0),optional_field(_RECORD_TRANSACTIONID,0),optional_field(_RECORD_SEQUENCE,0) from system.Tables where tableName=? and schema=? executed in 160 micros
2021-02-19T20:46:21.332: [TE] server1:48006 [start_id = 7] [pid = 148] [node_id = 3] MONITORED:RUNNING =>[debug,sql-statements] [4,4197123,DB,USER]:select tableName,tableId,currentVersion,schema,viewDefinition,cardinality,subtype,extends, optional_field(recordsbatchfactor,0),optional_field(objectid,0),optional_field(indexFormatVersion,0), optional_field(_RECORD_ID,0),optional_field(_RECORD_TRANSACTIONID,0),optional_field(_RECORD_SEQUENCE,0) from system.Tables where tableName=? and schema=? executed in 35 micros
2021-02-19T20:46:21.333: [TE] server1:48006 [start_id = 7] [pid = 148] [node_id = 3] MONITORED:RUNNING =>[debug,sql-statements] [4,4197123,DB,USER]:select tableName,tableId,currentVersion,schema,viewDefinition,cardinality,subtype,extends, optional_field(recordsbatchfactor,0),optional_field(objectid,0),optional_field(indexFormatVersion,0), optional_field(_RECORD_ID,0),optional_field(_RECORD_TRANSACTIONID,0),optional_field(_RECORD_SEQUENCE,0) from system.Tables where tableName=? and schema=? executed in 60 micros
2021-02-19T20:46:21.334: [TE] server1:48006 [start_id = 7] [pid = 148] [node_id = 3] MONITORED:RUNNING =>[debug,sql-statements] [4,4197123,DB,USER]:select getnodeid() from dual;
 executed in 29 micros
2021-02-19T20:46:21.335: [TE] server1:48006 [start_id = 7] [pid = 148] [node_id = 3] MONITORED:RUNNING =>[debug,sql-statements] [4,4197123]:ResultSet[833] append 18 bytes for 1 rows in 16 micros
2021-02-19T20:46:21.336: [TE] server1:48006 [start_id = 7] [pid = 148] [node_id = 3] MONITORED:RUNNING =>[debug,sql-statements] [4,4197123]:ResultSet[833] returned total 18 bytes for 1 rows. Open for 980 micros
2021-02-19T20:46:21.336: [TE] server1:48006 [start_id = 7] [pid = 148] [node_id = 3] MONITORED:RUNNING =>[debug,sql-statements] [4]: Txn 4197123 committed in 0 ms, open for 3 ms
...