Use the SeriLog Logging Extension
The SeriLog extension provides fully-structured events.
To use it, ensure you have referenced the package from NuGet and add the line for UseSeriLogLogging() line to the Runtime builder.
IRuntime runtime = new RuntimeFactory()
.UseSeriLogLogging()
.GetRuntimeInstance(new RuntimeOptions
{
Version = "stable",
UUID = "UUID_STRING",
LicenseKey = "LICENSE_KEY"
});
Configure SeriLog
The SeriLog logging extension converts the standard .NET adapter log configuration file to SeriLog config settings as it initializes SeriLog.
It also uses some extra configuration properties that determine the output format of log messages, fileoutputTemplate and consoleOutputTemplate.
These properties both use SeriLog's own format description language.
The following examples show the default formats.
fileoutputTemplate
{Timestamp:u} [{Level:u3}] ({SourceContext,-50} : {ThreadId,-2}) - {Message}{NewLine}{Exception}
consoleOutputTemplate
({SourceContext,-50} : {ThreadId,-2}) - {Message}{NewLine}{Exception}