This Library provides an API to register Logging to Fluentd using Serilog for an application.
The following package is required to consume this package:
- GiG.Core.Logging
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());
}
}
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 |
{
"Logging": {
"MinimumLevel": "Debug",
"Sinks": {
"Fluentd": {
"IsEnabled": true,
"Hostname": "localhost",
"Port": "24224"
}
}
}
}