suixiang-xiaoma

导航

使用.NET 6创建Windows Service项目并配置使用Serilog

一.创建Windows Service项目

二.添加Serilog对应的NuGet包

三.编写Serilog配置文件

双击打开appsettings.json,并录入以下配置:

四.在Program.cs启动代码中配置Serilog

 五.测试结果

 

posted on 2023-10-31 19:39  随想小马  阅读(242)  评论(0编辑  收藏  举报