Bewerken

Delen via


Setting the Event Level for a Text Log

SetupAPI writes a log entry to a text log only if the event level set for a text log is greater than or equal to the event level for the log entry, and the event category for the log entry is enabled for the text log.

The following table lists the event levels that SetupAPI supports and the manifest constants that represent these event levels. TXTLOG_ERROR is the lowest event level, followed by the next highest event level TXTLOG_WARNING, and so on. TXTLOG_VERY_VERBOSE is the highest event level.

Event level Event level manifest constant Event level manifest value

Write errors only.

TXTLOG_ERROR

1

Write errors and warnings of potential problems.

TXTLOG_WARNING

2

Write errors, warnings, and system state changes.

TXTLOG_SYSTEM_STATE_CHANGE

3

Write errors, warnings, system state changes, and high-level operations that are associated with state changes.

TXTLOG_SUMMARY

4

Write errors, warnings, system state changes, high-level operations that are associated with state changes, and most operational details.

TXTLOG_DETAILS

5

Write errors, warnings, system state changes, high-level operations that are associated with state changes, and all operational details.

TXTLOG_VERBOSE

6

Write all log entries, including those that might generate a large amount of information that is frequently superfluous.

TXTLOG_VERY_VERBOSE

7

To set the event level for the SetupAPI text logs, create (or modify) the following REG_DWORD registry value:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup\LogLevel

If the LogLevel registry value does not exist or has a value of zero, SetupAPI sets the event level for the application installation and device installation text logs to the default values described in the following table:

Text log Default value (Windows 7 and later versions) Default value (Windows Vista SP2) Default value (Windows Vista SP1 and previous versions)

Application installation text log (SetupAPI.app.log)

TXTLOG_SUMMARY

TXTLOG_WARNING

TXTLOG_DETAILS

Device installation text log (SetupAPI.dev.log)

TXTLOG_DETAILS

TXTLOG_DETAILS

TXTLOG_DETAILS

For more information about these text log files, see SetupAPI Text Logs.

The LogLevel registry value is formatted as 0xUUUUGHVW, where:

  • The low-order eight bits, represented by the mask 0x000000VW, specify whether logging is turned on for the application installation log and specify the event level for the application log.

  • The next highest eight bits, represented by the mask 0x0000GH00, specify whether logging is turned on for the device installation text log and specify the event level for the device installation text log.

  • The highest-level bits, represented by the mask 0xUUUU0000, are not used.

The value of the 0xVW bits controls logging for the application installation log as shown in the following table.

0xVW value Description

Zero (default)

Logging is turned on and the event level is set to the default value as described previously.

0x01 through 0x0F

Turns logging off.

0x10 through 0x7F

Turns logging on and sets the event level to 0xV.

The value of the 0xGH bits controls logging for the device installation text log as shown in the following table.

0xGH value Description

Zero (default)

Logging is turned on and the event level is set to the default value as described previously.

0x01 through 0x0F

Turns logging off.

0x10 through 0x7F

Turns logging on and sets the event level to 0xG.

The following table provides examples of typical LogLevel values.

LogLevel value Event levels set for the text logs

0x00000000

By default, turns logging on for the application installation log and the device installation log. Sets the logging level to the default values for both logs.

0x00000101

Turns logging off for both the application installation log and the device installation log.

0x00001010

Turns logging on for the application installation log and the device installation log. Sets the logging level to TXTLOG_ERROR for both logs.

0x00002020

Turns logging on for the application installation log and the device installation log. Sets the logging level to TXTLOG_WARNING for both logs.

0x00005050

Turns logging on for the application installation log and the device installation log. Sets the logging level to TXTLOG_DETAILS for both logs.

0x00006060

Turns logging on for the application installation log and the device installation log. Sets the logging level to TXTLOG_VERBOSE for both logs.

0x00007070

Turns logging on for the application installation log and the device installation log. Sets the logging level to TXTLOG_VERY_VERBOSE for both logs.