> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# log_* session settings

> ClickHouse session settings in the log_* generated group.

These settings are available in [system.settings](https://clickhouse.com/docs/reference/system-tables/settings.md) and are autogenerated from [source](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).

## log\_comment

Specifies the value for the `log_comment` field of the [system.query\_log](https://clickhouse.com/docs/reference/system-tables/query_log.md) 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](https://clickhouse.com/docs/resources/develop-contribute/contribute/tests.md).

Possible values:

* Any string no longer than [max\_query\_size](https://clickhouse.com/docs/reference/settings/session-settings/max.md#max_query_size). If the max\_query\_size is exceeded, the server throws an exception.

**Example**

Query:

```sql theme={null}
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:

```text theme={null}
┌─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](https://clickhouse.com/docs/reference/system-tables/query_log.md) system table (populates `formatted_query` column in the [system.query\_log](https://clickhouse.com/docs/reference/system-tables/query_log.md)).

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

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

See also:

* [`system.processors_profile_log`](https://clickhouse.com/docs/reference/system-tables/processors_profile_log)
* [`EXPLAIN PIPELINE`](https://clickhouse.com/docs/reference/statements/explain#explain-pipeline)

## log\_profile\_events

Type

Bool

Default

1

Log query performance statistics into the query\_log, query\_thread\_log and query\_views\_log.
