コード例 #1
0
 protected override void OnException(ExceptionContext filterContext)
 {
     //write your custom code here
     //objLog.Info(filterContext.Exception.Data.Values); will get the controller and action method
     AsyncLogger.Error(filterContext.Exception.Message);
     AsyncLogger.Error(filterContext.Exception.InnerException.Message);
     AsyncLogger.Error(filterContext.Exception.Source);
     AsyncLogger.Error(filterContext.Exception.StackTrace);
 }
コード例 #2
0
        public override void OnException(HttpActionExecutedContext objContext)
        {
            AsyncLogger.Error(objContext.Exception.Message);
            AsyncLogger.Error(objContext.Exception.Source);
            AsyncLogger.Error(objContext.Exception.StackTrace);

            if (objContext.Exception is NotImplementedException)
            {
                //context.Response = new  HttpResponseMessage(HttpStatusCode.NotImplemented);
                //write your custom code here
                //objLog.Info(filterContext.Exception.Data.Values); will get the controller and action method
            }
        }
コード例 #3
0
 /// <summary>
 /// Logging a general message in the log file
 /// </summary>
 /// <param name="strText">Text to log</param>
 public static void LogMessage(string strText)
 {
     AsyncLogger.Info(strText);
 }