On this page
SingleStoreDB supports logging all or specific queries in a general query log by configuring engine variables.
query. file, which typically resides in the
general_: Controls whether database queries are logged.
OFF(default): No queries are logged.
PARTIAL: Logs only a subset 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 trace log.
To log user queries, you can set the
general_ variable on all aggregator nodes.
general_: Specifies the file in which connections and queries are logged.
log_ file By default, this variable is set to
log For query logging to take place,
general_must be set to
PARTIAL, depending on your requirements.
minimal_: Defines the minimal disk space in MB, which, when reached on the disk where the data directories (such as logs, snapshots, blobs, plancache, auditlogs, and tracelogs) are mounted, SingleStore will halt new write queries.
disk_ space As query log files can potentially grow in size until the disk limit is reached, it is important to monitor this configuration.
tracelogsdir: The path to the log destination directory, which contains the
query.file among others.
log By default, this variable points to the
Note: If a query includes Remote Procedure Call (RPC) data, the RPC data is logged as a JSON string rather than query text.
Query logs can generate large files over time and may require a log rotation policy to be implemented.
query. file can be rotated by moving the
query. file and then sending
SIGHUP to the
query. and continue writing.
query. is a text file, you may want to compress the file after rotation to free up disk space.
For an illustration of the
query. file rotation, refer to Rotating Trace Log to Manage its Size.
Last modified: June 22, 2022