gpt4 book ai didi

asp.net-core - 为什么我看不到来自 Serilog 的控制台日志?

转载 作者:行者123 更新时间:2023-12-05 02:58:54 25 4
gpt4 key购买 nike

我是 Serilog 的新手,我能够登录到一个文件,但我似乎无法在控制台中看到我的日志。

在我的控制台中,这是我看到的:

https://gyazo.com/7bf1dbf4eef0ed334576a170f6f73f0f

这是我对 Serilog 的设置

{
"Serilog": {
"Using": [
"Serilog.Sinks.Console"
],
"WriteTo": [
{
"Name": "Async",
"Args": {
"configure": [
{
"Name": "File",
"Args": {
"path": "log-.txt",
"rollingInterval": "Day",
"outputTemplate": "{Timestamp:o} [{Level:u3}] ({Application}/{MachineName}/{ThreadId}) {Message}{NewLine}{Exception}"
}
},
{
"Name": "Console"
}
]
}
}
]
}
}

最佳答案

documentation of the Serilog.Console sink (下面的屏幕截图)具有您需要配置的所有设置。

您似乎还混淆了控制台输出和调试输出。如果要写入调试输出,则需要使用 Serilog's Debug Sink相反。


Serilog Settings

关于asp.net-core - 为什么我看不到来自 Serilog 的控制台日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58507991/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com