> ## 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.

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>Type</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>Default</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          Changeable without restart
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

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

<h2 id="log_comment">
  log\_comment
</h2>

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

Possible values:

* Any string no longer than [max\_query\_size](/docs/reference/settings/session-settings/max#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; │
└─────────────┴───────────┘
```

<h2 id="log_formatted_queries">
  log\_formatted\_queries
</h2>

<SettingsInfoBlock type="Bool" default_value="0" />

Allows to log formatted queries to the [system.query\_log](/docs/reference/system-tables/query_log) system table (populates `formatted_query` column in the [system.query\_log](/docs/reference/system-tables/query_log)).

Possible values:

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

<h2 id="log_processors_profiles">
  log\_processors\_profiles
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.3"},{"label": "1"},{"label": "Enable by default"}]}]} />

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

See also:

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

<h2 id="log_profile_events">
  log\_profile\_events
</h2>

<SettingsInfoBlock type="Bool" default_value="1" />

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