

# Logging options

**Warning**  
Use verbose logging for troubleshooting. Store log files securely and remove them when they are no longer needed.

On Windows, configure driver-wide logging through **Logging Options** or the driver registry settings described below.

## Log level
<a name="odbc-v4-driver-logging-options-log-level"></a>

This option enables ODBC driver logs with different levels of detail. In Windows, you can use the registry or a dialog box to configure logging. The option is located in the following registry path:

```
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Amazon Athena\ODBC\Driver
```

The following log levels are available:
+ `OFF` - Logging is disabled
+ `ERROR` - Only error messages are logged
+ `WARN` - Warning messages and errors are logged
+ `INFO` - Informational messages, warnings, and errors are logged
+ `DEBUG` - Detailed debug information plus all lower level messages are logged
+ `TRACE` - Most detailed level of logging, includes all messages

A value that the driver does not recognize causes the connection to fail with SQLSTATE `HY000`. An empty value is treated as not set. If the level in the registry or `odbc.ini` is anything other than `OFF`, `LogPath` must also be set. Otherwise the connection fails with the message `LogLevel enables logging but LogPath is missing`.

The driver accepts `LogLevel` in a DSN or connection string but only validates the value. The logging level in effect is the one set in the Windows registry or `odbc.ini`.

**Note**  
Each log level includes all messages from the levels below it. Higher log levels may impact performance and generate larger log files.



| **Connection string name** | **Parameter type** | **Default value** | **Connection string example** | 
| --- | --- | --- | --- | 
| LogLevel | Optional | OFF | LogLevel=INFO; | 

## Log path
<a name="odbc-v4-driver-logging-options-log-path"></a>

Specifies path to the file where the ODBC driver logs are stored. You can use the registry or a dialog box to set this value. The option is located in the following registry path:

```
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Amazon Athena\ODBC\Driver
```

At the `ERROR` and `WARN` levels, the driver creates the log file when it writes the first message.



| **Connection string name** | **Parameter type** | **Default value** | **Connection string example** | 
| --- | --- | --- | --- | 
| LogPath | Optional | none | LogPath=C:\\Users\\{{username}}\\projects\\internal\\trunk\\; | 

## Use Amazon Logger
<a name="odbc-v4-driver-logging-options-use-aws-logger"></a>

Specifies if Amazon SDK logging is enabled. Specify 1 to enable, 0 to disable.



| **Driver-wide setting** | **Parameter type** | **Default value** | **Setting example** | 
| --- | --- | --- | --- | 
| UseAwsLogger | Optional | 0 | UseAwsLogger=0 | 

**Note**  
Set `UseAwsLogger=1` to include SDK logs. Use verbose SDK logging for troubleshooting and protect the generated log files.