Configuring ODBC logs
The following parameters control whether and how the ODBC client driver logs messages between the client and server.
The way you set these parameters differs between operating systems:
-
On Linux and macOS, edit
vertica.ini
you created during the installation. For example, to log all warnings and more severe messages to log files in/tmp/
:[Driver] LogLevel=4 LogPath=/tmp
-
On Windows, edit the keys in the Windows Registry under
HKEY_LOCAL_MACHINE\SOFTWARE\Vertica\ODBC\Driver
.
Parameters
-
LogLevel: The severity of messages that are logged between the client and the server. The valid values are:
-
0: No logging
-
1: Fatal errors
-
2: Errors
-
3: Warnings
-
4: Info
-
5: Debug
-
6: Trace (all messages)
The value you specify for this setting sets the minimum severity for a message to be logged. For example, setting LogLevel to 3 means that the client driver logs all warnings, errors, and fatal errors.
-
-
LogPath: The absolute path of a directory to store log files. For example:
/var/log/verticaodbc
Diverting log entires to ETW (windows)
On Windows clients, ODBC log entries can be sent to Event Tracing for Windows (ETW) so they appear in the Windows Event Viewer:
-
Register the driver as a Windows Event Log provider and enable the logs.
-
Activate ETW by adding a string value LogType with data ETW to your Windows Registry.
-
Understand how Vertica compresses log levels for the Windows Event Viewer.
-
Know where to find the logs within Event Viewer.
-
Understand the meaning of the Event IDs in your log entries.
Registering the ODBC driver as a windows event log provider
To use ETW logging, you must register the ODBC driver as a Windows Event Log provider. You can choose to register either the 32-bit or 64-bit driver. After you have registered the driver, you must enable the logs.
Important
If you do not both register the driver and enable the logs, output is directed to stdout.-
Open a command prompt window as Administrator, or launch the command prompt with the Run as Administrator option.
Important
You must have administrator privileges to successfully complete the next step. -
Run the command
wevtutil im
to register either the 32-bit or 64-bit version of the driver.-
For the 64-bit ODBC driver, run:
wevtutil im "c:\Program Files\Vertica Systems\ODBC64\lib\VerticaODBC64.man" /resourceFilePath:"c:\Program Files\Vertica Systems\ODBC64\lib\vertica_9.1_odbc_3.5.dll" /messageFilePath:"c:\Program Files\Vertica Systems\ODBC64\lib\vertica_9.1_odbc_3.5.dll"
-
For the 32-bit ODBC driver, run:
wevtutil im "c:\Program Files (x86)\Vertica Systems\ODBC32\lib\VerticaODBC32.man" /resourceFilePath:"c:\Program Files (x86)\Vertica Systems\ODBC32\lib\vertica_9.1_odbc_3.5.dll" /messageFilePath:"c:\Program Files (x86)\Vertica Systems\ODBC32\lib\vertica_9.1_odbc_3.5.dll"
-
-
Run the command
wevtutil sl
to enable the logs.-
For 64-bit ODBC driver logs, run:
wevtutil sl VerticaODBC64/e:true
-
For the 32-bit ODBC driver logs, run:
wevtutil sl VerticaODBC32/e:true
Note
Should you want to later disable the logs, you can use the samewevtutil sl
command, substituting/e:false
in place of/e:true
when you issue the statement. Alternatively, you can enable or disable logs within the Windows Event Viewer itself. -
Add the string value LogType
By default, Vertica does not send ODBC log entries to ETW. To activate ETW, add the string LogType
to your Windows registry, and set its value to ETW
.
-
Start the registry editor by typing
regedit.exe
in the Windows Run command box. -
Navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Vertica\ODBC\Driver
in the registry. -
Right-click in the right pane of the Registry Editor window.
-
Select New, then select String Value.
-
Change the name of the string value from
New Value #1
toLogType
. -
Double-click the new
LogType
entry. When prompted for a new value, enterETW
. -
Exit the registry editor.
ETW is disabled by default. When ETW is enabled, you can disable it by clearing the value ETW from the LogType string.
LogLevel in the windows event viewer
While LogLevel ranges from 0 through 6, this range is compressed for the Windows Event Viewer to a range of 0 through 3.
Vertica LogLevel Setting | Vertica LogLevel Description | Log level sent to the Windows Event Viewer | Log level displayed by the Windows Event Viewer |
---|---|---|---|
0 | (No logging) | 0 | (No logging) |
1 | Fatal Errors | 1 | Critical |
2 | Errors | 2 | Error |
3 | Warnings | 3 | Warning |
4 | Info | 4 | Information |
5 | Debug | 4 | |
6 | Trace (all messages) | 4 |
The following examples show how LogLevel is converted when displayed in the Windows Event Viewer.
-
A LogLevel of 5 sends fatal errors, errors, warnings, info and debug log level entries to Event Viewer as Level 4 (Information).
-
A LogLevel of 6 sends fatal errors, errors, warnings, debug and trace log level entries to Event Viewer as Level 4.
Finding logs in the event viewer
-
Launch the Windows Event Viewer.
-
From Event Viewer (Local), expand Applications and Services Logs.
-
Expand the folder that contains the log you want to review (for example,
VerticaODBC64
). -
Select the Vertica ODBC log under the folder. Entries appear in the right pane.
-
Note the value in the Event ID field. Each Event Log entry includes one of four Event IDs:
-
0: Informational (debug, info, and trace events)
-
1: Error
-
2: Fatal event
-
3: Warning
-