Skip to content

lurumad/serilog-sinks-kafka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serilog.Sinks.Kafka

Writes Serilog events to a Kafka.

Log.Logger = new LoggerConfiguration()
	.WriteTo.Kafka(batchSizeLimit: 50, period: 1, brokers: brokers, topic: topic)
	.CreateLogger();

JSON appsettings.json configuration

A Serilog settings provider that reads from Microsoft.Extensions.Configuration, .NET Core's appsettings.json file.

Configuration is read from the Serilog section.

{
  "Serilog": {
    "Using": [ "Serilog.Sinks.Kafka" ],
    "MinimumLevel": {
      "Override": {
        "Microsoft": "Warning",
        "System": "Warning"
      }
    },
    "WriteTo": [
      {
        "Name": "Kafka",
        "Args": { "batchSizeLimit" : "50", "period" : "5", "brokers" : "10.2.1.174:32768", "topic": "demo" }
      }
    ],
    "Properties": {
      "Application": "Kafka"
    }
  }
}

Samples

You can see how to configure Serilog.Sinks.Kafka using WriteTo or ReadFrom and test it with a SimpleConsumer:

SimpleConsumer

_Copyright © 2016 Lurumad Contributors

About

A Serilog Sink that writes to Kafka

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages