Writes Serilog events to Scalyr. This sink uses the addEvents API to insert structured log events.
Install the Serilog.Sinks.Scalyr package from NuGet:
Install-Package Serilog.Sinks.Scalyr
To configure the sink in C# code, call WriteTo.Scalyr()
during logger configuration:
var log = new LoggerConfiguration()
.WriteTo.Scalyr("token", "logfile")
.CreateLogger();
token "Write Logs" API token. Find API tokens at https://www.scalyr.com/keys.
logfile The name of the log file being written to. This will probably be the name of your app.
batchSizeLimit The maximum number of events to include in a single batch.
period The time to wait between checking for event batches.
queueLimit Maximum number of events in the queue.
sessionInfo Additional information about the session. See https://www.scalyr.com/help/api.
scalyrUri The base URI for Scalyr. Defaults to https://scalyr.com.
outputTemplate A message template describing the output messages. See https://github.com/serilog/serilog/wiki/Formatting-Output.
restrictedToMinimumLevel The minimum log event level required in order to write an event to the sink.