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
<PackageReference Include="ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP" Version="9.0.0" />
<PackageVersion Include="ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP" Version="9.0.0" />
<PackageReference Include="ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP" />
paket add ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP --version 9.0.0
#r "nuget: ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP, 9.0.0"
#addin nuget:?package=ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP&version=9.0.0
#tool nuget:?package=ChrisForte.Microsoft.Extensions.Logging.LogstashHTTP&version=9.0.0
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
Product | Versions 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. |
-
.NETStandard 2.1
- Microsoft.Extensions.Hosting (>= 9.0.3)
- Microsoft.Extensions.Logging (>= 9.0.3)
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