I have an problem cacting the HTTP Error 404.0 - Not Found. I have turned on the
Have you implemented an ErrorController that handles the redirects in your customErrors attributes? In your case, it would look something like this:
public class ErrorController : Controller
{
public ActionResult General()
{
return View();
}
public ActionResult HttpError404()
{
return View();
}
public ActionResult HttpError500()
{
return View();
}
}
You would also need to implement the views for each of the ActionResults in your Views folder.
In terms of logging the error, you would need to implement this in the Application_Error event handler as follows:
protected void Application_Error()
{
var exception = Server.GetLastError();
var httpException = exception as HttpException;
// Do logging here
}
This is to "catch" the error before the 302 redirect to your Error pages defined in the ErrorController above.