public override void Log(ExceptionLoggerContext context) {
            var contextData = new ContextData();
            contextData.MarkAsUnhandledError();
            contextData.SetSubmissionMethod("ExceptionLogger");
            contextData.Add("HttpActionContext", context.ExceptionContext.ActionContext);

            context.Exception.ToExceptionless(contextData).Submit();
        }
Example #2
0
 public virtual void LogCore(ExceptionLoggerContext context)
 {
 }
Example #3
0
 /// <summary>
 /// Logs exceptions that are not handled.
 /// </summary>
 /// <param name="context"></param>
 public override void Log(ExceptionLoggerContext context)
 {
     Trace.TraceError(context.ExceptionContext.Exception.ToString());
 }
 public override void Log(ExceptionLoggerContext context)
 {
     Its.Log.Instrumentation.Log.Write(() => context.ExceptionContext.Exception.ToString());
 }
Example #5
0
 public override void Log(ExceptionLoggerContext context)
 {
     _logger.LogError("WebApiExceptionLogger", context.ExceptionContext.Exception);
     base.Log(context);
 }
Example #6
0
 public Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
 {
     _log.Error(context.Exception, "Unhandled exception!");
     return(Task.FromResult <object>(null));
 }
Example #7
0
 /// <inheritdoc />
 public override bool ShouldLog(ExceptionLoggerContext context)
 {
     return(context?.Exception != null);
 }
 public override void Log(ExceptionLoggerContext context)
 {
     _log.Error("Unhandled exception", context.Exception);
 }
Example #9
0
        public override void Log(ExceptionLoggerContext context)
        {
            var xxx = context.Request;

            Trace.TraceError(context.ExceptionContext.Exception.ToString());
        }
Example #10
0
 public override void Log(ExceptionLoggerContext context)
 {
     NewRelic.Api.Agent.NewRelic.NoticeError(context.ExceptionContext.Exception);
 }
Example #11
0
        public override bool ShouldLog(ExceptionLoggerContext context)
        {
            var x = context.Exception;

            return(x != null && !(x is TaskCanceledException) && !(x is ObjectNotFoundException));
        }
 public override void Log(ExceptionLoggerContext context)
 {
     _logger.WriteError(context.Exception, "Internal server error:");
 }
 public override void Log(ExceptionLoggerContext context)
 {
     Serilog.Log.Logger.Error(context.Exception, "HTTP {Method} {RawUrl} responded {StatusCode}.", context.Request.Method, context.Request.RequestUri.AbsolutePath, "500");
 }
Example #14
0
 private string GetActionName(ExceptionLoggerContext context)
 {
     return(((System.Web.Http.Controllers.ReflectedHttpActionDescriptor)((System.Web.Http.Controllers.HttpActionDescriptor[])context.ExceptionContext.ControllerContext.RouteData.Route.DataTokens["actions"])[0]).ActionName);
 }
        public override void Log(ExceptionLoggerContext context)
        {
            var log = context.Exception.ToString();

            logger.Error(log);
        }
Example #16
0
 public Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
 {
     Log.Error(context.Exception, context.ExceptionContext.Request.RequestUri.ToString());
     return(Task.CompletedTask);
 }
Example #17
0
 public Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
 {
     ExceptionHandler.Invoke(this, context.Exception);
     return(Task.FromResult(0));
 }
Example #18
0
        /// <inheritdoc />
        public override void Log(ExceptionLoggerContext context)
        {
            var contextWrapper = new ExceptionLoggerContextWrapper(context);

            _logger.Log(context.Exception, contextWrapper);
        }
Example #19
0
 public override void Log(ExceptionLoggerContext context)
 {
     Trace.WriteLine(context.Exception.ToString());
 }
Example #20
0
        /// <inheritdoc />
        public override Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
        {
            var contextWrapper = new ExceptionLoggerContextWrapper(context);

            return(_logger.LogAsync(context.Exception, contextWrapper, cancellationToken));
        }
Example #21
0
        public Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
        {
            Logger.ErrorException("Unhandled exception", context.Exception);

            return(Task.FromResult <object>(null));
        }
Example #22
0
 public override void Log(ExceptionLoggerContext context)
 {
     Nlog.Log(LogLevel.Error, context.Exception, RequestToString(context.Request));
 }
 public override bool ShouldLog(ExceptionLoggerContext context)
 {
     return(true);
 }
Example #24
0
 public override Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
 {
     _logger.LogError("WebApiExceptionLogger", context.ExceptionContext.Exception);
     return(base.LogAsync(context, cancellationToken));
 }
Example #25
0
        public override void Log(ExceptionLoggerContext context)
        {
            string messsage = "全局异常捕获 Url:" + context.Request.RequestUri.ToString();

            logger.Error(context.Exception, messsage);
        }
Example #26
0
        public override void Log(ExceptionLoggerContext context)
        {
            string loggerName = context.Exception.TargetSite != null && context.Exception.TargetSite.DeclaringType != null ? context.Exception.TargetSite.DeclaringType.Name : "NLogExceptionLogger";

            Logger.Error().Exception(context.Exception).Message("Unhandled error: {0}", context.Exception.Message).LoggerName(loggerName).Write();
        }
 public override void Log(ExceptionLoggerContext context)
 {
     LoggerHelper.Write(string.Format("Unhandled exception processing " + context.Request.Method + " for " + context.Request.RequestUri + ": " + context.Exception));
 }
Example #28
0
 public virtual Task LogAsyncCore(ExceptionLoggerContext context,
                                  CancellationToken cancellationToken)
 {
     LogCore(context);
     return(Task.FromResult(0));
 }
Example #29
0
 public override void Log(ExceptionLoggerContext context)
 {
     base.Log(context);
 }
Example #30
0
        /// <summary>
        ///     When overridden in a derived class, logs the exception synchronously.
        /// </summary>
        /// <param name="context">The exception logger context.</param>
        public override void Log(ExceptionLoggerContext context)
        {
            TraceEntry traceEntry = context.Request?.GetTraceEntry();

            this.Logger.Log(2, context.Exception.Message, context.Request, "ASP.NET Error", 0UL, string.Empty, traceEntry, context.Exception);
        }
Example #31
0
 public override void Log(ExceptionLoggerContext context)
 {
     LogHelper.Error(context.ExceptionContext.ControllerContext.Controller.GetType(), "WebApi Exception", context.Exception);
 }