Преглед изворни кода

!1230 发送异常日志时先判断logMsg,避免因logMsg异常漏发邮件
Merge pull request !1230 from ir0nmax/next

zuohuaijun пре 2 година
родитељ
комит
2dce90fc83
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      Admin.NET/Admin.NET.Core/Logging/DatabaseLoggingWriter.cs

+ 1 - 1
Admin.NET/Admin.NET.Core/Logging/DatabaseLoggingWriter.cs

@@ -123,7 +123,7 @@ public class DatabaseLoggingWriter : IDatabaseLoggingWriter, IDisposable
                 // 将异常日志发送到邮件
                 if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysErrorMail))
                 {
-                    await App.GetRequiredService<IEventPublisher>().PublishAsync(CommonConst.SendErrorMail, loggingMonitor.exception);
+                    await App.GetRequiredService<IEventPublisher>().PublishAsync(CommonConst.SendErrorMail, logMsg.Exception ?? loggingMonitor.exception);
                 }
 
                 return;