ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP 9.0.0

dotnet add package ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP --version 9.0.0
                    
NuGet\Install-Package ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP -Version 9.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="ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP" Version="9.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP" Version="9.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP --version 9.0.0
                    
#r "nuget: ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP, 9.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.
#addin nuget:?package=ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP&version=9.0.0
                    
Install ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP as a Cake Addin
#tool nuget:?package=ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP&version=9.0.0
                    
Install ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP as a Cake Tool

Microsoft.Extensions.Logging.LogstashHTTP

HTTPClient logging provider for Microsoft.Extensions.Logging that allows logging to a Logstash endpoint using HTTP.

Usage

In the IHostBuilder chained configuration methods, use .AddLogstash(configuration) under Services.AddLogging().

IHost host = Host.CreateDefaultBuilder(args)
    .ConfigureServices((context, services) => 
    {
        services.AddLogging(logging => 
        {
            logging.ClearProviders();
            logging.AddLogstash(configuration => 
            {
                context.Configuration.GetSection(LogstashLoggerOptions.SectionName).Bind(configuration);

                // or

                configuration.Url = "http://<your-logstash-endpoint>";
                configuration.Port = 1234;
                configuration.Username = "<optional, pipeline username>";
                configuration.Password = "<optional, pipeline password>";
                configuration.TimeoutSeconds = 10; // time (in seconds) to wait for each HTTP request to Logstash
                configuration.BackoffTimeoutSeconds = 30; // time (in seconds) to wait if the Logstash endpoint is unreachable
                configuration.MinimumLogLevel = LogLevel.Information;
            });
        })
    })
    .Build();

Use the configuration delegate action to configure the logging options. The configuration can be loaded from appsettings or configured manually.

Messages are processed and written immediately, and use a message processor and message queue to send log entries to your Logstash endpoint. If the Logstash endpoint is unreachable, log entries will be queued in-memory and retried based on the BackoffTimeoutSeconds interval.

Note: In-memory log entries are not saved to disk, and will be lost if the application shuts down before the Logstash endpoint is reachable again.

Logstash pipeline

input {
	http {
		port => 1234
		type => http
		codec => json
		user => "<optional, pipeline username>"
		password => "<optional, pipeline password>"
	}
}

Download

NuGet version (ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP)

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
9.0.0 151 4/9/2025

- Initial release