> ## 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_queries_* 세션 설정

> log_queries_* 생성 그룹에 속한 ClickHouse 세션 설정입니다.

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
  }}>유형</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>기본값</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          재시작 없이 변경 가능
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

이러한 설정은 [system.settings](/docs/ko/reference/system-tables/settings)에서 확인할 수 있으며, [소스](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp)로부터 자동 생성됩니다.

<div id="log_queries">
  ## log\_queries
</div>

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

쿼리 로깅을 활성화합니다.

이 설정이 적용되면 ClickHouse에 전송된 쿼리는 [query\_log](/docs/ko/reference/settings/server-settings/settings#query_log) 서버 구성 매개변수의 규칙에 따라 기록됩니다.

예시:

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

<div id="log_queries_cut_to_length">
  ## log\_queries\_cut\_to\_length
</div>

<SettingsInfoBlock type="UInt64" default_value="100000" />

쿼리 길이가 지정된 임계값(바이트 단위)보다 크면 query log에 기록할 때 쿼리를 잘라냅니다. 또한 일반 텍스트 로그에 출력되는 쿼리의 길이도 제한합니다.

<div id="log_queries_min_query_duration_ms">
  ## log\_queries\_min\_query\_duration\_ms
</div>

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

활성화된 경우(0이 아닌 값), 이 설정값보다 더 빠른 쿼리는 로그에 기록되지 않습니다([MySQL Slow Query Log](https://dev.mysql.com/doc/refman/5.7/slow-query-log.html)의 `long_query_time`와 유사하다고 볼 수 있습니다). 즉, 이러한 쿼리는 다음 테이블에서 찾을 수 없습니다.

* `system.query_log`
* `system.query_thread_log`

다음 유형의 쿼리만 로그에 기록됩니다.

* `QUERY_FINISH`

* `EXCEPTION_WHILE_PROCESSING`

* 유형: 밀리초

* 기본값: 0(모든 쿼리)

<div id="log_queries_min_type">
  ## log\_queries\_min\_type
</div>

<SettingsInfoBlock type="LogQueriesType" default_value="QUERY_START" />

기록할 `query_log`의 최소 유형입니다.

Possible values:

* `QUERY_START` (`=1`)
* `QUERY_FINISH` (`=2`)
* `EXCEPTION_BEFORE_START` (`=3`)
* `EXCEPTION_WHILE_PROCESSING` (`=4`)

`query_log`에 기록될 항목을 제한하는 데 사용할 수 있습니다. 예를 들어 오류에만 관심이 있다면 `EXCEPTION_WHILE_PROCESSING`을 사용할 수 있습니다:

```text theme={null}
log_queries_min_type='EXCEPTION_WHILE_PROCESSING'
```

<div id="log_queries_probability">
  ## log\_queries\_probability
</div>

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

지정된 확률에 따라 무작위로 선택된 일부 쿼리만 [query\_log](/docs/ko/reference/system-tables/query_log), [query\_thread\_log](/docs/ko/reference/system-tables/query_thread_log), [query\_views\_log](/docs/ko/reference/system-tables/query_views_log) 시스템 테이블(system tables)에 기록하도록 허용합니다. 초당 쿼리 수가 매우 많을 때 부하를 줄이는 데 도움이 됩니다.

가능한 값:

* 0 — 쿼리가 시스템 테이블에 기록되지 않습니다.
* \[0..1] 범위의 양의 부동소수점 수. 예를 들어 설정 값이 `0.5`이면 전체 쿼리 중 약 절반이 시스템 테이블에 기록됩니다.
* 1 — 모든 쿼리가 시스템 테이블에 기록됩니다.
