Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

log_* session settings

These settings are available in system.settings and are autogenerated from source.

log_comment

Specifies the value for the log_comment field of the system.query_log table and comment text for the server log.

It can be used to improve the readability of server logs. Additionally, it helps to select queries related to the test from the system.query_log after running clickhouse-test.

Possible values:

  • Any string no longer than max_query_size. If the max_query_size is exceeded, the server throws an exception.

Example

Query:

SET log_comment = 'log_comment test', log_queries = 1;
SELECT 1;
SYSTEM FLUSH LOGS;
SELECT type, query FROM system.query_log WHERE log_comment = 'log_comment test' AND event_date >= yesterday() ORDER BY event_time DESC LIMIT 2;

Result:

┌─type────────┬─query─────┐
│ QueryStart  │ SELECT 1; │
│ QueryFinish │ SELECT 1; │
└─────────────┴───────────┘

log_formatted_queries

Type
Bool
Default
0

Allows to log formatted queries to the system.query_log system table (populates formatted_query column in the system.query_log).

Possible values:

  • 0 — Formatted queries are not logged in the system table.
  • 1 — Formatted queries are logged in the system table.

log_processors_profiles

Type
Bool
Default
1
Version history
VersionDefault valueComment
24.31Enable by default

Write time that processor spent during execution/waiting for data to system.processors_profile_log table.

See also:

log_profile_events

Type
Bool
Default
1

Log query performance statistics into the query_log, query_thread_log and query_views_log.

Navigation