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



The information in this article applies to:

  • Microsoft Windows Server 2003, Standard Edition
  • Microsoft Windows XP Professional
  • Microsoft Windows Server 2003, Enterprise Edition
  • Microsoft Windows Server 2003, Datacenter Edition
  • Microsoft Windows 2000 Datacenter Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Professional

This article was previously published under Q221833
Important This article contains information about how to modify the registry. Make sure to 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

SUMMARY

The versions of Microsoft Windows listed in the "Applies to" section include debug logging of the user profile and the Windows system policy processes. To turn on debug logging, modify the registry on the computer where the logging occurs. The debug logging functionality is also available with Microsoft Windows NT 4.0, but the functionality requires a checked (debug) build of the Userenv.dll file on Windows NT 4.0.

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 the output of this logging to troubleshoot problems with user profiles and Group Policy processing.

MORE INFORMATION

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 your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

Use Registry Editor to add the following registry value (or modify it, if the value already exists):

Key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon
Value: UserEnvDebugLevel
Value Type: REG_DWORD
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 (where the value is 0X00000000).

You can also combine the values. For example, you can combine VERBOSE 0x00000002 and LOGFILE 0x00010000 to get 0x00010002. So if UserEnvDebugLevel is set with a value of 0x00010002, this turns on both LOGFILE and VERBOSE. Combining these values is the same as using an OR statement:

0x00010000 OR 0x00000002 = 0x00010002

Note If you set UserEnvDebugLevel = 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 exists and is greater than 300 KB, the existing file will be renamed to Userenv.bak, and a new log file created.

Modification Type:MajorLast Reviewed:7/6/2005
Keywords:kbhowto KB221833