For my other article "ASP.NET Error Types and Handling Methods", I mentioned that errors can be written to the Windows log for developers to view. However, Asp.Net does not have permission to write Windows logs by default. To set this, we need to modify the registry.
"Start"->"Run"->"RegEdit" until HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesEventlog
"Usage Permissions"->Security "Add", add Asp.net account, and grant read permissions - >Save and exit the registry.
Next, in Asp.net we can use the following C# code to write Windows logs:
string strMessage = Server.GetLastError().Message;
Server.ClearError();
if(!EventLog.SourceExists("mySource"))
EventLog.CreateEventSource("mySource","myLog");
EventLog Event = new EventLog();
Event.Source = "mySource";
Event.WriteEntry(strMessage,EventLogEntryType.Information);
My machine: WindowsXp SP2, VisualStudio.Net2003