/// <summary> /// Setups the exception handlers. /// </summary> /// <param name="configuration">The configuration.</param> /// <param name="messageHandler">The message handler.</param> /// <param name="pgpLogger">The PGP logger.</param> public static void SetupExceptionHandlers( HttpConfiguration configuration, IMessageHandler messageHandler, IPGPLogger pgpLogger) { configuration.Services.Add(typeof(IExceptionLogger), new GlobalExceptionLogger(pgpLogger)); configuration.Services.Replace(typeof(IExceptionHandler), new GlobalExceptionHandler(messageHandler)); }
public override void OnActionExecuting(HttpActionContext actionContext) { m_startedDate = DateTime.Now; m_logger = actionContext.RequestContext.Configuration.Services.GetCurrentApiLogger(); }
/// <summary> /// Initializes a new instance of the <see cref="GlobalExceptionLogger"/> class. /// </summary> public GlobalExceptionLogger(IPGPLogger apiLogger) { m_apiLogger = apiLogger; }