1
0
Fork 0
mirror of https://github.com/win-acme/win-acme.git synced 2026-04-27 03:55:56 +03:00
2 Advanced logging
David Peden edited this page 2019-03-06 09:53:35 -06:00

The program users Serilog for logging which is a powerful extensible library. By default the program logs to the console window and selected events are persisted into the Windows Event Viewer, but you may want to extend this based on your infrastructure.

Rolling log files example

  • Download Serilog.Sinks.File.dll and Serilog.Sinks.RollingFile.dll from NuGet. These DLLs can be found here and here, respectively.
  • Add the following lines to wacs.exe.config
<add key="serilog:using:RollingFile" value="Serilog.Sinks.RollingFile" />
<add key="serilog:write-to:RollingFile.pathFormat" value="wacs-{Date}.log" />
<add key="serilog:write-to:RollingFile.retainedFileCountLimit" value="30" />

Seq example

  • Download Serilog.Sinks.PeriodicBatching.dll and Serilog.Sinks.Seq.dll from NuGet. These DLLs can be found here and here, respectively.
  • Add the following lines to wacs.exe.config
<add key="serilog:using:Seq" value="Serilog.Sinks.Seq" />
<add key="serilog:write-to:Seq.serverUrl" value="http://localhost:5341" />

Changing the Log Level

You can change the log level by adding the following setting:

<add key="serilog:minimum-level" value="Verbose" />

Additional information on leg levels can be found here.

Other sinks

There are many types of output channels called sinks for all kinds of different databases, file formats and services.