/serilog-sinks-loggly

A Serilog event sink that writes to Loggly

Primary LanguageC#Apache License 2.0Apache-2.0

Serilog.Sinks.Loggly

Build status NuGet Version

Loggly is a cloud based log management service. Create a new input and specify that you want to use a http input with JSON enabled. Use the loggly-csharp-configuration XML configuration syntax to configure the sink.

Package - Serilog.Sinks.Loggly | Platforms - .NET 4.5

var log = new LoggerConfiguration()
    .WriteTo.Loggly()
    .CreateLogger();

Properties will be sent along to Loggly. The level is sent as a category.

To use a durable logger (that will save messages localy if the connectio nto the server is unavailable, and resend once the connection has recovered), set the bufferBaseFilename argument in the Loggly() extension method.

var log = new LoggerConfiguration()
    .WriteTo.Loggly(bufferBaseFilename:@"C:\test\buffer")
    .CreateLogger();

This will write unsent messages to a buffer-{Date}.json file in the specified folder (C:\test\ in the example).