Serilog.Sinks.Logz.Io - A Serilog sink sending log events over HTTP
Package - Serilog.Sinks.Logz.Io | Platforms - .NET 4.5, .NET Standard 2.0
Table of contents
Super simple to use
In the following example, the sink will POST log events to https://app.logz.io over HTTPS.
ILogger log = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.LogzIo("<logzio token>", "<log type>", useHttps: true)
.CreateLogger();
log.Information("Logging {@Heartbeat} from {Computer}", heartbeat, computer);
More advanced configuration is also available:
ILogger log = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.LogzIo("<logzio token>", "<log type>",
new LogzioOptions
{
UseHttps = true,
RestrictedToMinimumLevel = LogEventLevel.Debug,
Period = TimeSpan.FromSeconds(15),
BatchPostingLimit = 50
})
.CreateLogger();
Install via NuGet
If you want to include the HTTP sink in your project, you can install it directly from NuGet.
To install the sink, run the following command in the Package Manager Console:
PM> Install-Package Serilog.Sinks.Logz.Io