Log of Errors logs in Asp.net 1.1

0

Someone knows how I can log logs of uncontrolled errors in asp.net (vs2003 .net 1.1). I currently have this in the web.config:

<customErrors mode="On" defaultRedirect="paginaDeError.htm"/>

But that error page shows a generic message, apart from showing that message I need somewhere to register the complete exception with the message stack etc, someone can help me achieve that.

Greetings.

    
asked by RSillerico 05.08.2016 в 22:18
source

1 answer

1

You could see if you can enable ELMAH

elmah site

ELMAH nuget

this allows to take a detailed log that you could analyze.

But another alternative could be to remove the <customErrors and define some other way to redirect after logging the problem

ASP .NET Error Handling

you could define the event Application_Error

void Application_Error(object sender, EventArgs e)
{
    Exception exc = Server.GetLastError();

    //aqui registras el error en algun log

    if (exc is HttpUnhandledException)
    {
        // Pass the error on to the error page.
        Server.Transfer("ErrorPage.aspx", true);
    }
}

then in this you can take the exception, register it and then redirect to the page that shows the generic message

    
answered by 05.08.2016 / 23:10
source