> ## 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_query_* セッション設定

> log_query_* 生成グループに含まれる ClickHouse のセッション設定。

これらの設定は [system.settings](https://clickhouse.com/docs/ja/reference/system-tables/settings.md) で確認でき、[ソースコード](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) から自動生成されています。

## log\_query\_settings

型

Bool

デフォルト値

1

クエリ設定をquery\_logとOpenTelemetryのspanログに記録します。

## log\_query\_threads

型

Bool

デフォルト値

0

クエリスレッドのログ記録を設定します。

クエリスレッドは [system.query\_thread\_log](https://clickhouse.com/docs/ja/reference/system-tables/query_thread_log.md) テーブルに記録されます。この設定は、[log\_queries](https://clickhouse.com/docs/ja/reference/settings/session-settings/log-queries.md#log_queries) が true の場合にのみ有効です。この設定を有効にすると、ClickHouse が実行するクエリのスレッドが、サーバー設定パラメータ [query\_thread\_log](https://clickhouse.com/docs/ja/reference/settings/server-settings/settings/query.md#query_thread_log) のルールに従って記録されます。

設定可能な値:

* 0 — 無効。
* 1 — 有効。

**例**

```text theme={null}
log_query_threads=1
```

## log\_query\_views

型

Bool

デフォルト値

1

クエリビューのログ記録を設定します。

この設定を有効にして ClickHouse が実行するクエリに関連するビュー (materialized view または live view) がある場合、それらはサーバー設定パラメータ [query\_views\_log](https://clickhouse.com/docs/ja/reference/settings/server-settings/settings/query.md#query_views_log) に記録されます。

例:

```text theme={null}
log_query_views=1
```
