Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 1.4 KB

GiG.Core.Logging.Sinks.Fluentd.md

File metadata and controls

56 lines (44 loc) · 1.4 KB

GiG.Core.Logging.Sinks.Fluentd

This Library provides an API to register Logging to Fluentd using Serilog for an application.

Pre-requisites

The following package is required to consume this package:

  • GiG.Core.Logging

Basic Usage

Make use of ConfigureLogging(x => x.WriteToFluentd()) when creating an IHostBuilder. Logging requires configuration.

static class Program
{
    public static void Main()
    {
        CreateHostBuilder().Build().Run();
    }

    private static IHostBuilder CreateHostBuilder()
    {
        return Host
            .CreateDefaultBuilder()
            .ConfigureLogging(x => x.WriteToFluentd());
    }
}

Configuration

The below table outlines the valid Configurations used to override the FluentdSinkOptions under the Config section Logging:Sinks:Fluentd

Configuration Name Type Optional Default Value
IsEnabled Boolean Yes false
Hostname String Yes localhost
Port Int Yes 24224

Sample Configuration

 {
   "Logging": {
     "MinimumLevel": "Debug",
     "Sinks": {
      "Fluentd": {
        "IsEnabled": true, 
        "Hostname": "localhost",
        "Port": "24224"
      }
     }
   }
 }