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

# How to configure logging for clickhouse-odbc-bridge

> Set the log files and the log level of clickhouse-odbc-bridge with the odbc_bridge_* keys in the logger section of the ClickHouse server configuration.

`clickhouse-odbc-bridge` is a separate program that the ClickHouse server starts when a query uses the [`ODBC` table engine](https://clickhouse.com/docs/reference/engines/table-engines/integrations/odbc), the [`odbc` table function](https://clickhouse.com/docs/reference/functions/table-functions/odbc) or an ODBC dictionary source. Its logging is configured in the configuration of the server: add `odbc_bridge_*` keys to the `logger` section, and the server passes them to the bridge when it starts it.

This applies to self-managed ClickHouse.

## Configuration

Create a file in the `config.d` directory of the server, for example `/etc/clickhouse-server/config.d/odbc_bridge_logging.xml`:

```xml theme={null}
<clickhouse>
    <logger>
        <odbc_bridge_log>/var/log/clickhouse-server/clickhouse-odbc-bridge.log</odbc_bridge_log>
        <odbc_bridge_errlog>/var/log/clickhouse-server/clickhouse-odbc-bridge.err.log</odbc_bridge_errlog>
        <odbc_bridge_stdout>/var/log/clickhouse-server/clickhouse-odbc-bridge.stdout</odbc_bridge_stdout>
        <odbc_bridge_stderr>/var/log/clickhouse-server/clickhouse-odbc-bridge.stderr</odbc_bridge_stderr>
        <odbc_bridge_level>trace</odbc_bridge_level>
    </logger>
</clickhouse>
```

The file is merged with the main configuration, so the `logger` settings of the server itself (`level`, `log`, `errorlog` and others) stay as they are.

Each key is optional and is turned into one command-line option of the bridge:

| Key in `logger` | Option passed to `clickhouse-odbc-bridge` | Purpose |
| - | - | - |
| `odbc_bridge_log` | `--log-path` | Path of the log file of the bridge |
| `odbc_bridge_errlog` | `--err-log-path` | Path of the error log file of the bridge |
| `odbc_bridge_stdout` | `--stdout-path` | Path of the file for the standard output of the bridge |
| `odbc_bridge_stderr` | `--stderr-path` | Path of the file for the standard error of the bridge |
| `odbc_bridge_level` | `--log-level` | Log level of the bridge, for example `trace` |

If a key is absent, the server does not pass the option and the bridge uses its own default. The server passes no other logging options, so its own `logger` settings do not apply to the bridge.

The files are written by the bridge process, so the directory must exist and be writable by the operating system user that the bridge runs as.

## When the change takes effect

The server reads these keys at the moment it starts the bridge. It starts the bridge when a query needs ODBC and no bridge is answering, and the bridge then keeps running with the options it was started with.

New logging settings therefore apply only to a newly started bridge. The running `clickhouse-odbc-bridge` process has to stop first; a normal restart of the server stops it. The server starts a new bridge with the current configuration the next time a query uses ODBC.

## Related pages

* [`clickhouse-odbc-bridge`](https://clickhouse.com/docs/concepts/features/tools-and-utilities/odbc-bridge)
* [`ODBC` table engine](https://clickhouse.com/docs/reference/engines/table-engines/integrations/odbc)
* [`logger` server setting](https://clickhouse.com/docs/reference/settings/server-settings/settings/other#logger)
* [Configuration files](https://clickhouse.com/docs/concepts/features/configuration/server-config/configuration-files.md)
