Server Settings

## listen\_host[​](#listen_host "Direct link to listen_host")

Restriction on hosts that requests can come from. If you want the server to answer all of them, specify `::`.

Examples:

```
<listen_host>::1</listen_host>
<listen_host>127.0.0.1</listen_host>
```

## listen\_reuse\_port[​](#listen_reuse_port "Direct link to listen_reuse_port")

Allow multiple servers to listen on the same address:port. Requests will be routed to a random server by the operating system. Enabling this setting is not recommended.

**Example**

```
<listen_reuse_port>0</listen_reuse_port>
```

## listen\_try[​](#listen_try "Direct link to listen_try")

The server will not exit if IPv6 or IPv4 networks are unavailable while trying to listen.

**Example**

```
<listen_try>0</listen_try>
```

## load\_marks\_threadpool\_pool\_size[​](#load_marks_threadpool_pool_size "Direct link to load_marks_threadpool_pool_size")

Size of background pool for marks loading

## load\_marks\_threadpool\_queue\_size[​](#load_marks_threadpool_queue_size "Direct link to load_marks_threadpool_queue_size")

Number of tasks which is possible to push into prefetches pool

## logger[​](#logger "Direct link to logger")

The location and format of log messages.

**Keys**:

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Key Description|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `async` When `true` (default) logging will happen asynchronously (one background thread per output channel). Otherwise it will log inside the thread calling LOG| `async_queue_max_size` When using async logging, the max amount of messages that will be kept in the the queue waiting for flushing. Extra messages will be dropped|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `console` Enable logging to the console. Set to `1` or `true` to enable. Default is `1` if ClickHouse does not run in daemon mode, `0` otherwise.| `console_log_level` Log level for console output. Defaults to `level`.| `console_shutdown_log_level` Shutdown level is used to set the console log level at server Shutdown.|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `console_startup_log_level` Startup level is used to set the console log level at server startup. After startup log level is reverted to the `console_log_level` setting| `count` Rotation policy: How many historical log files ClickHouse are kept at most.|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `errorlog` The path to the error log file.|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `formatting.type` Log format for console output. Currently, only `json` is supported| `level` Log level. Acceptable values: `none` (turn logging off), `fatal`, `critical`, `error`, `warning`, `notice`, `information`,`debug`, `trace`, `test`| `log` The path to the log file.|  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `rotation` Rotation policy: Controls when log files are rotated. Rotation can be based on size, time, or a combination of both. Examples: 100M, daily, 100M,daily. Once the log file exceeds the specified size or when the specified time interval is reached, it is renamed and archived, and a new log file is created.|  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `shutdown_level` Shutdown level is used to set the root logger level at server Shutdown.|  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `size` Rotation policy: Maximum size of the log files in bytes. Once the log file size exceeds this threshold, it is renamed and archived, and a new log file is created.|  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | | `startup_level` Startup level is used to set the root logger level at server startup. After startup log level is reverted to the `level` setting| `stream_compress` Compress log messages using LZ4. Set to `1` or `true` to enable.| `syslog_level` Log level for logging to syslog.|  |  | | --- | --- | | `use_syslog` Also forward log output to syslog. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

**Log format specifiers**

File names in `log` and `errorLog` paths support below format specifiers for the resulting file name (the directory part does not support them).

Column "Example" shows the output at `2023-07-06 18:32:07`.