SingleStore DB

Logging Queries

SingleStore DB supports logging queries by setting the general_log variable. When set, SingleStore DB logs queries into the queries.log file in the tracelogs directory. The general_log variable supports three values:

  • OFF (default). No queries are logged.

  • PARTIAL. Logs a sample of the queries running through the system. This mode is designed for minimal overhead: if multiple queries are trying to write to the query log simultaneously, only one will succeed and the other writes will be abandoned.

  • ON. Every query running through the system is logged. This mode has a significantly negative impact on performance as query execution now depends on writes to the tracelog.

If a query includes RPC data, the RPC data is logged as a JSON string rather than query text.

To log user queries, you can set the general_log variable on all aggregator nodes. For more information on how to set engine variables, see the engine variables overview.

Related Topics