M
MattC
I have some code that correctly writes to the eventlog on my local machine.
I have installed the application on the Live server and all is not well, no
event log entries.
My development box config is as follows:
Windows XP Pro running IIS 5.1
Web app using integrated auth using a local user account
Account has admin right over machine.
Entry has been placed in registry in
\HKLM\System\CurrentControlSet\Services\EventLog\Application\MyApp
On the Server:
Windows 2003 Server running IIS 6
Web app using integrated auth using a Active Directory account
Account is Domain admin
Entry has been placed in registry in
\HKLM\System\CurrentControlSet\Services\EventLog\Application\MyApp
my code is as follows:
Web.Config
<add key="eventlogname" value="MyApp" />
Global.asax.cs
protected void Application_Error(Object sender, EventArgs e)
{
string _message = "\nError in Path :" + Request.Path ; //Get the path of the
page
_message += "\n\nError Raw Url :" + Request.RawUrl ; //Get the QueryString
along with the Virtual Path
_message += "\n\nRequest from :" + Request.UserHostAddress;
_message += "\n\nError Message :" +
ConquestException.HandleConquestException(Server.GetLastError(), false);
System.Diagnostics.EventLog myLog = new System.Diagnostics.EventLog();
//Create a new EventLog object
myLog.Source =
Convert.ToString(ConfigurationSettings.AppSettings["eventlogname"]); //Set
the name of the Log
myLog.WriteEntry(_message,
System.Diagnostics.EventLogEntryType.Error);//Write the log
Server.Transfer("~/MyAppError.aspx");
}
I would really appreciate any help you can give me.
MattC
I have installed the application on the Live server and all is not well, no
event log entries.
My development box config is as follows:
Windows XP Pro running IIS 5.1
Web app using integrated auth using a local user account
Account has admin right over machine.
Entry has been placed in registry in
\HKLM\System\CurrentControlSet\Services\EventLog\Application\MyApp
On the Server:
Windows 2003 Server running IIS 6
Web app using integrated auth using a Active Directory account
Account is Domain admin
Entry has been placed in registry in
\HKLM\System\CurrentControlSet\Services\EventLog\Application\MyApp
my code is as follows:
Web.Config
<add key="eventlogname" value="MyApp" />
Global.asax.cs
protected void Application_Error(Object sender, EventArgs e)
{
string _message = "\nError in Path :" + Request.Path ; //Get the path of the
page
_message += "\n\nError Raw Url :" + Request.RawUrl ; //Get the QueryString
along with the Virtual Path
_message += "\n\nRequest from :" + Request.UserHostAddress;
_message += "\n\nError Message :" +
ConquestException.HandleConquestException(Server.GetLastError(), false);
System.Diagnostics.EventLog myLog = new System.Diagnostics.EventLog();
//Create a new EventLog object
myLog.Source =
Convert.ToString(ConfigurationSettings.AppSettings["eventlogname"]); //Set
the name of the Log
myLog.WriteEntry(_message,
System.Diagnostics.EventLogEntryType.Error);//Write the log
Server.Transfer("~/MyAppError.aspx");
}
I would really appreciate any help you can give me.
MattC