Logging overview
Lyftrondata logs information to a configured destination to ease problem resolution. Messages are logged using predefined levels of importance, given below from least to most important:
- Verbose
- Debug
- Information (initial default)
- Warning
- Error
- Fatal
When given level is set, then the whole Lyftrondata logs only messages on this level and on more important ones. For example, when default Information level is configured, then messages at Information, Warning, Error and Fatal are logged.
Currently, two kinds of log destination are supported:
- Rolling text file - a separate text file is created for example for each day,
- Seq - learn more at GetSeq.net.
Initial logging configuration is loaded from file logger.config, by default located in folder %ProgramData%\Lyftrondata\conf\. After Lyftrondata start-up, log level can only be modified using lyft_set_logging_level stored procedure.
Learn more about Serilog at GitHub.
Text files
Example config file setting up log in rolling text file:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="serilog:using:RollingFile" value="Serilog.Sinks.RollingFile" /> <add key="serilog:write-to:RollingFile.pathFormat" value="C:\ProgramData\Lyftrondata\logs\lyftrondata-{Date}.txt" /> <add key="serilog:write-to:RollingFile.retainedFileCountLimit" value="10" /> <add key="serilog:minimum-level" value="Verbose" /> </appSettings> </configuration>
Available parameters are:
- pathFormat - full file path, filename must include the {Date} placeholder
- fileSizeLimitBytes - limit of single file size, default 1GB
- retainedFileCountLimit - defines how many last files are retained, older are removed, default 31
Learn more in a logging library documentation at GitHub.
Seq
Example config file setting up log in Seq:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="serilog:using:Seq" value="Serilog.Sinks.Seq" /> <add key="serilog:write-to:Seq.serverUrl" value="http://localhost:5341"/> <add key="serilog:minimum-level" value="Verbose" /> </appSettings> </configuration>
Available parameters are:
- serverUrl - full address of Seq server
- apiKey - optional Seq API key
Learn more in a logging library documentation at GitHub.