Following the discussion from the official documentation on implementing an IExceptionLogger
(http://www.asp.net/web-api/overview/testing-and-debugging/web-api-glob
ExceptionFilterAttribute
is not deprecated.
Why not?
An IExceptionLogger
can't set a response.
You have to use an ExceptionFilterAttribute
or an IExceptionHandler
to handle exceptions with a custom response message.
As the name suggest it can only log the exception.
The ExceptionLoggerContext.ExceptionContext
has an Response
porperty. You can set the property to a HttpRespnseMessage
but it has no effect on the response.
Maybe IExceptionHandler
deprecates ExceptionFilterAttribute
. But i don't know.