1
나는이 post (@ 이반 즐 라테 브 대답)의 도움으로 ELMAH를 구현했습니다. 잘 작동합니다. 하지만 이제 오류 메시지와 함께 기본 오류 페이지를 리디렉션해야합니다.ELMAH가 구현 된 후 기본 오류 페이지로 리디렉션하는 방법은 무엇입니까?
어떻게하면됩니까? 나는 ELMAH로 읽고 있었고, 우리는 사용자 정의 오류 페이지를 구현할 수 없습니다. 사실입니까?
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new ElmahHandledErrorLoggerFilter());
filters.Add(new HandleErrorAttribute());
}
public class ElmahHandledErrorLoggerFilter : IExceptionFilter
{
public void OnException(ExceptionContext context)
{
// Log only handled exceptions, because all other will be caught by ELMAH anyway.
if (context.ExceptionHandled)
ErrorSignal.FromCurrentContext().Raise(context.Exception);
}
}