Diverting OLE DB Log Entries to ETW

On Windows clients, you can direct Vertica to send OLE DB log entries to Event Tracing for Windows (ETW). Once set, OLE DB log entries appear in the Windows Event Viewer. To use ETW:

  • Register the driver as a Windows Event Log provider, and enable the logs.
  • Activate ETW by adding a string value 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.

Register the OLE DB Driver as a Windows Event Log Provider, and Enable the Logs

To use ETW logging, you must register the OLE DB driver as a Windows Event Log provider. You can choose to register either the 32-bit or 64-bit driver. Once you have registered the driver, you must enable the logs.

If you do not both register the driver and enable the logs, output is directed to stdout.

  1. Open a command prompt window as Administrator, or launch the command prompt with the Run as Administrator option.

    You must have administrator privileges to successfully complete the next step.

  2. Run the command wevtutil im to register either the 32-bit or 64-bit version of the driver.

    1. For the 64-bit OLE DB driver, run:

      wevtutil im "c:\Program Files\Vertica Systems\OLEDB64\lib\VerticaOLEDB64.man" 
      /resourceFilePath:"c:\Program Files\Vertica Systems\OLEDB64\lib\vertica_8.1_oledb.dll" 
      /messageFilePath:"c:\Program Files\Vertica Systems\OLEDB64\lib\vertica_8.1_oledb.dll"
    2. For the 32-bit OLE DB driver, run:

      wevtutil im "c:\Program Files (x86)\Vertica Systems\OLEDB32\lib\VerticaOLEDB32.man" 
      /resourceFilePath:"c:\Program Files (x86)\Vertica Systems\OLEDB32\lib\vertica_8.1_oledb.dll" 
      /messageFilePath:"c:\Program Files (x86)\Vertica Systems\OLEDB32\lib\vertica_8.1_oledb.dll"
  3. Run the command wevtutil sl to enable the logs.

    1. For 64-bit OLE DB driver logs, run:

      wevtutil sl VerticaOLEDB64/e:true
    2. For the 32-bit ODBC driver logs, run:

      wevtutil sl VerticaOLEDB32/e:true

    Should you want to later disable the logs, you can use the same wevtutil 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 OLE DB log entries to ETW. To activate ETW, add the string LogType to your Windows registry, and set its value to ETW.

  1. Start the registry editor by typing regedit.exe in the Windows Run command box.
  2. Navigate to the correct location in the registry.

    HKEY_LOCAL_MACHINE\SOFTWARE\Vertica\OLEDB\Driver
    
  3. Right-click in the right pane of the Registry Editor window. Select New and then select String Value.
  4. Change the name of the string value from New Value #1 to LogType.

  5. Double-click the new LogType entry. When prompted for a new value, enter ETW.
  6. Exit the registry editor.

ETW is off by default. When ETW is activated, you can subsequently turn it off by clearing the value ETW from the LogType string.

Event Viewer Log Levels

The LogLevel parameter setting is described in the section, Additional Parameter Settings. The parameter allows you to specify a LogLevel of 0 through 6. Be aware that Vertica compresses the log levels for the Windows Event Viewer. The six levels are compressed to four in Event Viewer.

Vertica LogLevel Setting Vertica LogLevel Description Entries are sent to Event Viewer as log level... Event Viewer Displays...

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

Examples:

  • A LogLevel setting of 5 sends fatal errors, errors, warnings, info and debug log level entries to Event Viewer as Level 4 (Information).
  • A LogLevel setting of 6 sends fatal errors, errors, warnings, debug and trace log level entries to Event Viewer as Level 4.

Where to Find Logs in Event Viewer

  1. Launch the Windows Event Viewer.
  2. From Event Viewer (Local), expand Applications and Services Logs.
  3. Expand the folder that contains the log you want to review (for example, VerticaOLEDB64).
  4. Select the Vertica OLE DB log under the folder. Entries appear in the right pane.

Event Log Entry: Event ID

Once you have chosen an OLE DB log in Event Viewer, note the value in the Event ID field.

Each Event Log entry includes one of four Event IDs. An Event ID of 0 is informational (debug, info, and trace events), 1 is an error, 2 is a fatal event, and 3 is a warning.