小编Chr*_*dez的帖子

Serilog 无法登录我的本地数据库

我正在尝试使用 Serilog 登录我的 .NET 项目,但我注意到错误没有写入数据库。我打开 Serilog 的 SelfLog,这是显示的错误:

2022-11-01T15:58:26.9744639Z Unable to write 1 log events to the database due to following error: A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)

这是我在 Program.cs 中对 Serilog 的设置:

var columnOptions = new ColumnOptions();
        columnOptions.Store.Remove(StandardColumn.Properties);
        columnOptions.Store.Remove(StandardColumn.MessageTemplate);
        columnOptions.TimeStamp.NonClusteredIndex = true;
Log.Logger = new LoggerConfiguration()
                    .ReadFrom.Configuration(Config)
                    .Enrich.FromLogContext()
                    .Enrich.WithExceptionDetails()
                    .WriteTo.Console() …
Run Code Online (Sandbox Code Playgroud)

c# database asp.net logging serilog

2
推荐指数
1
解决办法
1317
查看次数

标签 统计

asp.net ×1

c# ×1

database ×1

logging ×1

serilog ×1