lcl před 1 dnem
rodič
revize
458c90c0fb
1 změnil soubory, kde provedl 8 přidání a 5 odebrání
  1. 8 5
      AppStart/LogHelper.cs

+ 8 - 5
AppStart/LogHelper.cs

@@ -15,7 +15,7 @@ public class LogHelper
 
     string[] BlackList = { "服务商平台查询申请单状态API", "服务商平台查询分账结果API", "查询签约申请的结果", "支付宝查询分账结果" };
 
-    public void WriteLog(string Content, string FileName)
+    public void WriteLog(string Content, string FileName, bool sls = false)
     {
         if(BlackList.Contains(FileName))
         {
@@ -28,10 +28,13 @@ public class LogHelper
             RedisDbconn.Instance.SetExpire(key, 3600);
         }
         function.WriteLog(Content, FileName);
-        Dictionary<string, string> dic = new Dictionary<string, string>();
-        dic.Add("Topic", FileName);
-        dic.Add("Content", Content);
-        RedisDbconn.Instance.AddList("SlsLogQueue", Newtonsoft.Json.JsonConvert.SerializeObject(dic));
+        if(sls)
+        {
+            Dictionary<string, string> dic = new Dictionary<string, string>();
+            dic.Add("Topic", FileName);
+            dic.Add("Content", Content);
+            RedisDbconn.Instance.AddList("SlsLogQueue", Newtonsoft.Json.JsonConvert.SerializeObject(dic));
+        }
     }
 
     public void Start()