/Serilog.Sinks.Scalyr

Serilog sink that writes to Scalyr

Primary LanguageC#MIT LicenseMIT

Serilog.Sinks.Scalyr

NuGet Version

Writes Serilog events to Scalyr. This sink uses the addEvents API to insert structured log events.

Getting started

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.

Optional parameters

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.