Microsoft KB Archive/221833

From BetaArchive Wiki
Knowledge Base

How to enable user environment debug logging in retail builds of Windows

Article ID: 221833

Article Last Modified on 10/11/2007


  • PolicyMaker Standard Edition 2.0
  • PolicyMaker Standard Edition 1.0
  • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
  • Microsoft Windows Server 2003, Enterprise Edition
  • Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
  • Microsoft Windows Server 2003, Standard x64 Edition
  • Microsoft Windows Server 2003, Enterprise x64 Edition
  • Microsoft Windows Server 2003, Datacenter x64 Edition
  • Microsoft Windows XP Professional
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Datacenter Server

This article was previously published under Q221833

Important This article contains information about how to modify the registry. Make sure that you back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry


The versions of Microsoft Windows that are listed in the "Applies to" section let you modify the registry to turn on debug logging of the user profile and the Windows system policy processes. You can also use this logging to track down problems that are related to the start of Desktop Standard PolicyMaker client-side extensions (CSEs). Debug logging functionality is also available in Microsoft Windows NT 4.0. However, in Windows NT 4.0, this functionality requires a checked (debug) build of the Userenv.dll file.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

154120 Debugging user profiles and system policies in Windows NT 4.0

You can use debug logging output to troubleshoot problems with user profiles and Group Policy processing.


Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

Use Registry Editor to add or to modify the following registry entry:

Subkey: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon
Entry: UserEnvDebugLevel
Value data: 10002 (Hexadecimal)

UserEnvDebugLevel can have the following values:

NONE 0x00000000
NORMAL 0x00000001
VERBOSE 0x00000002
LOGFILE 0x00010000
DEBUGGER 0x00020000

The default value is NORMAL|LOGFILE (0x00010001).

Note To disable logging, select NONE (0x00000000).

You can combine these values. For example, you can combine VERBOSE 0x00000002 and LOGFILE 0x00010000 to get 0x00010002. Therefore, if UserEnvDebugLevel is given a value of 0x00010002, LOGFILE and VERBOSE are both turned on. Combining these values is the same as using an OR statement.

0x00010000 OR 0x00000002 = 0x00010002

Note If you set UserEnvDebugLevel to 0x00030002, the most verbose details are logged in the Userenv.log file.

The log file is written to the %Systemroot%\Debug\UserMode\Userenv.log file. If the Userenv.log file is larger than 300 KB, the file is renamed Userenv.bak, and a new Userenv.log file is created. This action occurs when a user logs on locally or by using Terminal Services, and the Winlogon process starts. However, because the size check only occurs when a user logs on, the Userenv.log file may grow beyond the 300 KB limit.

The 300 KB limit cannot be modified.

Additional query words: enable tracing logging

Keywords: kbhowto KB221833