These settings are available in system.settings and are autogenerated from source.
log_queries
Setting up query logging.
Queries sent to ClickHouse with this setup are logged according to the rules in the query_log server configuration parameter.
Example:
log_queries=1log_queries_cut_to_length
If query length is greater than a specified threshold (in bytes), then cut query when writing to query log. Also limit the length of printed query in ordinary text log.
log_queries_min_query_duration_ms
If enabled (non-zero), queries faster than the value of this setting will not be logged (you can think about this as a long_query_time for MySQL Slow Query Log), and this basically means that you will not find them in the following tables:
system.query_logsystem.query_thread_log
Only the queries with the following type will get to the log:
-
QUERY_FINISH -
EXCEPTION_WHILE_PROCESSING -
Type: milliseconds
-
Default value: 0 (any query)
log_queries_min_type
query_log minimal type to log.
Possible values:
QUERY_START(=1)QUERY_FINISH(=2)EXCEPTION_BEFORE_START(=3)EXCEPTION_WHILE_PROCESSING(=4)
Can be used to limit which entities will go to query_log, say you are interested only in errors, then you can use EXCEPTION_WHILE_PROCESSING:
log_queries_min_type='EXCEPTION_WHILE_PROCESSING'log_queries_probability
Allows a user to write to query_log, query_thread_log, and query_views_log system tables only a sample of queries selected randomly with the specified probability. It helps to reduce the load with a large volume of queries in a second.
Possible values:
- 0 — Queries are not logged in the system tables.
- Positive floating-point number in the range [0..1]. For example, if the setting value is
0.5, about half of the queries are logged in the system tables. - 1 — All queries are logged in the system tables.