How to debug WinLogon.exe?

You can use the GFlags.exe application to enable debugging options for Window Login application.

GFlags.exe ships with the Windows Debugging tools. (Get Windows Debugging Tools here.)

Run the GFlags.exe and check the options: Debug WinLOGON, Enable debugging of Win32 SubSystem and Debug initial command.

This results in running the Winlogon in the Windows Symbolic Debugger (Ntsd.exe) with the -d parameter, which directs its output to the kernel debugger console. (Refer for more details)

Note that you should setup a kernel mode debugging session for this to be effective.