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();
        }
Exemplo n.º 2
0
 public virtual void LogCore(ExceptionLoggerContext context)
 {
 }
Exemplo n.º 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());
 }
Exemplo n.º 5
0
 public override void Log(ExceptionLoggerContext context)
 {
     _logger.LogError("WebApiExceptionLogger", context.ExceptionContext.Exception);
     base.Log(context);
 }
Exemplo n.º 6
0
 public Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
 {
     _log.Error(context.Exception, "Unhandled exception!");
     return(Task.FromResult <object>(null));
 }
Exemplo n.º 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);
 }
Exemplo n.º 9
0
        public override void Log(ExceptionLoggerContext context)
        {
            var xxx = context.Request;

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

            return(x != null && !(x is TaskCanceledException) && !(x is ObjectNotFoundException));
        }
Exemplo n.º 12
0
 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");
 }
Exemplo n.º 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);
        }
Exemplo n.º 16
0
 public Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
 {
     Log.Error(context.Exception, context.ExceptionContext.Request.RequestUri.ToString());
     return(Task.CompletedTask);
 }
Exemplo n.º 17
0
 public Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
 {
     ExceptionHandler.Invoke(this, context.Exception);
     return(Task.FromResult(0));
 }
Exemplo n.º 18
0
        /// <inheritdoc />
        public override void Log(ExceptionLoggerContext context)
        {
            var contextWrapper = new ExceptionLoggerContextWrapper(context);

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

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

            return(Task.FromResult <object>(null));
        }
Exemplo n.º 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);
 }
Exemplo n.º 24
0
 public override Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
 {
     _logger.LogError("WebApiExceptionLogger", context.ExceptionContext.Exception);
     return(base.LogAsync(context, cancellationToken));
 }
Exemplo n.º 25
0
        public override void Log(ExceptionLoggerContext context)
        {
            string messsage = "全局异常捕获 Url:" + context.Request.RequestUri.ToString();

            logger.Error(context.Exception, messsage);
        }
Exemplo n.º 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));
 }
Exemplo n.º 28
0
 public virtual Task LogAsyncCore(ExceptionLoggerContext context,
                                  CancellationToken cancellationToken)
 {
     LogCore(context);
     return(Task.FromResult(0));
 }
Exemplo n.º 29
0
 public override void Log(ExceptionLoggerContext context)
 {
     base.Log(context);
 }
Exemplo n.º 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);
        }
Exemplo n.º 31
0
 public override void Log(ExceptionLoggerContext context)
 {
     LogHelper.Error(context.ExceptionContext.ControllerContext.Controller.GetType(), "WebApi Exception", context.Exception);
 }