发生错误时,Serilog接收器未在Docker容器中发送电子邮件

时间:2018-06-25 04:21:36

标签: .net docker core serilog

Log.Logger = new LoggerConfiguration()
     .WriteTo.Console(restrictedToMinimumLevel: LogEventLevel.Verbose)
     .WriteTo.Email(new EmailConnectionInfo()
     {
         FromEmail = configuration["Email:fromEmail"],
         EmailSubject = configuration["Email:subjectEmail"],
         ToEmail = configuration["Email:toEmail"],
         MailServer = configuration["Email:mailServer"],
     },
     restrictedToMinimumLevel: LogEventLevel.Error)
     .CreateLogger();

这是我的代码。它可以在本地环境中发送电子邮件,但不能在docker容器中发送电子邮件。有人可以看看发生了什么吗?谢谢

0 个答案:

没有答案