SimpleGelf.Extensions.Logging 1.0.0

dotnet add package SimpleGelf.Extensions.Logging --version 1.0.0                
NuGet\Install-Package SimpleGelf.Extensions.Logging -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SimpleGelf.Extensions.Logging" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimpleGelf.Extensions.Logging --version 1.0.0                
#r "nuget: SimpleGelf.Extensions.Logging, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SimpleGelf.Extensions.Logging as a Cake Addin
#addin nuget:?package=SimpleGelf.Extensions.Logging&version=1.0.0

// Install SimpleGelf.Extensions.Logging as a Cake Tool
#tool nuget:?package=SimpleGelf.Extensions.Logging&version=1.0.0                

That class example demostrate as to use provider.

The appsettings.json file may config:

"LogConfig": { "NameFile": "C:\Logs\ApiBIlling\apiLog", "LogEventLevel": 4, "FlushToDiskIntervalHour": 24, "Providers": [ "File", "Console", "Graylog" ] }, "GelfLoggerConfig": { "User": "", "Password": "", "UsingAuthenticate": false, "Host": "http://127.0.0.1", "Port": 12201, "LogSource": "billing_api", "HttpTimeoutSeconds": 30, "ListLogLevel": [ 4, 5 ] },

public class ApplicationLogging : ILoggingService { private static ILoggerFactory _Factory = null; const string providerConsole = "CONSOLE"; const string providerFile = "FILE"; const string providerGrayLog = "GRAYLOG";

    public ApplicationLogging(ILoggerFactory factory, LogConfig logConfig, GelfLoggerConfig gelfLoggerConfig)
    {
        var hasLoggerConsole = logConfig.Providers.Any(x => x.ToUpper().Equals(providerConsole));
        var hasLoggerFile = logConfig.Providers.Any(x => x.ToUpper().Equals(providerFile));
        var hasLoggerGrayLog = logConfig.Providers.Any(x => x.ToUpper().Equals(providerGrayLog));

        var configLogger = new LoggerConfiguration()
               .MinimumLevel.Override("Microsoft", (LogEventLevel)logConfig.LogEventLevel)
               .Enrich.FromLogContext();

        if (hasLoggerConsole)
            configLogger.WriteTo.Console();
        
        if(hasLoggerFile)
            configLogger.WriteTo.File($"{logConfig.NameFile}.txt",
                                        rollingInterval: RollingInterval.Day,
                                        flushToDiskInterval: new TimeSpan(logConfig.FlushToDiskIntervalHour, 0, 0),
                                        restrictedToMinimumLevel: (LogEventLevel)logConfig.LogEventLevel,
                                        rollOnFileSizeLimit: true);

        Log.Logger = configLogger.CreateLogger();

        if (hasLoggerGrayLog)
            factory.AddSimpleGelf(gelfLoggerConfig);

        _Factory = factory.AddSerilog(Log.Logger);
    }
 
    public ILoggerFactory LoggerFactory
    {
        get
        {
            return _Factory;
        }            
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 1,296 7/20/2018

This is simple extension the .Net Core for using as provider loggin..