使用.NET 6创建Windows Service项目并配置使用Serilog
一.创建Windows Service项目
二.添加Serilog对应的NuGet包
三.编写Serilog配置文件
双击打开appsettings.json,并录入以下配置:
四.在Program.cs启动代码中配置Serilog
五.测试结果
一.创建Windows Service项目
二.添加Serilog对应的NuGet包
三.编写Serilog配置文件
双击打开appsettings.json,并录入以下配置:
四.在Program.cs启动代码中配置Serilog
五.测试结果