Пример #1
0
        public static ExceptionWithCapturedContext Capture(Exception ex, CapturedHttpContext httpContext, bool isHandled = false, Guid? correlationID = null)
        {
            // Capture the thread-specific bits first before we jump into async execution:
            var context = new ExceptionWithCapturedContext(
                ex,
                isHandled: isHandled,
                correlationID: correlationID,
                webHostingContext: hostingContext,
                capturedHttpContext: httpContext
            );

            return context;
        }
Пример #2
0
 public static Task<ILogIdentifier> Log(ExceptionWithCapturedContext context)
 {
     // Run the exception logger asynchronously:
     return Task.Run(async () => await logger.Write(context));
 }