Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是初学者。我想知道如何在 RestApi 中配置 Serilog 以将日志写入 Seq。webapiconfig 和 Controller 中的配置应该是什么。以及如何为此编写日志事件
首先你需要在你的机器上安装 SEQ 服务器。服务器将自己注册为您机器中的服务。此服务在默认端口号 5341 上运行
在 Global.asax 文件中,您需要创建记录器的实例。
在控制器中可以使用变量Log将各个级别的日志写入seq server