zhoufan 4 年 前
コミット
2b40a27491

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/App_Start/ErrorAttribute.cs

@@ -37,7 +37,7 @@ namespace CallCenterApi.Interface
37 37
                 Params.Add(key, rt.Params[key]);
38 38
             }
39 39
 
40
-            log.Error(Params.ToJson() + "\r\n" + context.Exception.ToString());
40
+            log.Error("系统异常,请求信息:" + Params.ToJson(), context.Exception);
41 41
         }
42 42
     }
43 43
 }

+ 5 - 0
CallCenterCommon/CallCenter.Utility/log/Log.cs

@@ -1,4 +1,5 @@
1 1
 using log4net;
2
+using System;
2 3
 
3 4
 namespace CallCenter.Utility
4 5
 {
@@ -17,6 +18,10 @@ namespace CallCenter.Utility
17 18
         {
18 19
             this.logger.Error(RequestString.GetIP() + "  " + message);
19 20
         }
21
+        public void Error(object message, Exception ex)
22
+        {
23
+            this.logger.Error(RequestString.GetIP() + "  " + message, ex);
24
+        }
20 25
         public void Info(object message)
21 26
         {
22 27
             this.logger.Info(RequestString.GetIP() + "  " + message);