Pacem.Extensions.Logging.Http 0.10.12

There is a newer version of this package available.
See the version list below for details.
dotnet add package Pacem.Extensions.Logging.Http --version 0.10.12
                    
NuGet\Install-Package Pacem.Extensions.Logging.Http -Version 0.10.12
                    
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="Pacem.Extensions.Logging.Http" Version="0.10.12" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pacem.Extensions.Logging.Http" Version="0.10.12" />
                    
Directory.Packages.props
<PackageReference Include="Pacem.Extensions.Logging.Http" />
                    
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 Pacem.Extensions.Logging.Http --version 0.10.12
                    
#r "nuget: Pacem.Extensions.Logging.Http, 0.10.12"
                    
#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.
#:package Pacem.Extensions.Logging.Http@0.10.12
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Pacem.Extensions.Logging.Http&version=0.10.12
                    
Install as a Cake Addin
#tool nuget:?package=Pacem.Extensions.Logging.Http&version=0.10.12
                    
Install as a Cake Tool

HTTP Logging Extensions

⚗️ ==Experimental==

⚠️ Experimental libs are discouraged to use in production.

About

Pacem.Extensions.Logging.Http provides extensions to ship your logs to an HTTP endpoint (a webhook, a log-ingestion API, a collector, ...).

Delivery goes through IHttpClientFactory (a named client, pacem.logger.http) and is performed by a background consumer, one entry at a time, so logging calls never block on the network.

⚠️ The IHttpClientFactory pipeline logs its own requests under the System.Net.Http.* categories. Left unfiltered those entries feed straight back into this sink and amplify without bound — scope the sink to the categories you actually care about (builder.AddFilter(...) or the Filter option) or silence System.Net.Http.

The following paragraphs exemplify the library utilization given common use cases.

How to

Add the relevant logger provider to the logging builder (e.g. ILoggingBuilder). There are two ways to describe a delivery.

1. Converter mode — build the request, the sink sends it

Provide a HttpRequestLogPayload -> HttpRequestMessage converter. Use the configureClient overload to set the base address, headers or timeout of the named client.

// Program.cs
builder.Logging.AddPacemHttpLogging(
    // log line -> request
    log => new HttpRequestMessage(HttpMethod.Post, "/ingest")
    {
        Content = JsonContent.Create(new
        {
            timestamp = log.Timestamp,
            source = log.Name,
            level = log.LogLevel.ToString(),
            message = log.Message,
            error = log.Exception?.ToString(),
            data = log.Data
        })
    },
    client =>
    {
        client.BaseAddress = new Uri("https://logs.example.com");
        client.DefaultRequestHeaders.Add("X-Api-Key", "…");
    });

2. Executor mode — you own the send

Provide a (HttpClient, HttpRequestLogPayload) -> Task. Handy when you call an SDK, batch differently, or need the response.

builder.Logging.AddPacemHttpLogging(
    async (client, log) =>
    {
        using var response = await client.PostAsJsonAsync("/ingest", new
        {
            source = log.Name,
            level = log.LogLevel.ToString(),
            message = log.Message
        });
        response.EnsureSuccessStatusCode();
    },
    client => client.BaseAddress = new Uri("https://logs.example.com"));

A fourth overload takes a Func<IHttpClientFactory, HttpRequestLogPayload, HttpClient> instead of an Action<HttpClient>, when you want to pick or build the client per entry.

ℹ️ If neither a converter nor an executor is configured the provider throws on the first write.

Options

Every overload accepts an optional trailing Action<HttpLoggerOptions>:

Option Purpose
FormatHttpRequestMessage The converter (set by the converter-mode overloads).
SendHttpLogAsync The executor (set by the executor-mode overloads).
CreateHttpClient Custom per-entry client selection from the IHttpClientFactory.
Filter Func<HttpRequestLogPayload, bool> evaluated on the fully-built payload before it is queued. Return false to drop it.
builder.Logging.AddPacemHttpLogging(
    log => new HttpRequestMessage(HttpMethod.Post, "/ingest") { /* … */ },
    client => client.BaseAddress = new Uri("https://logs.example.com"),
    // don't ship our own transport noise back over HTTP
    options => options.Filter = log => !log.Name.StartsWith("System.Net.Http"));

Plans for version next

Optional client-side batching and a retry / dead-letter policy.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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
0.10.18-selberg 32 10/1/2026
0.10.18-riemann 84 9/26/2026
0.10.18-pascal 90 9/21/2026
0.10.17 94 9/18/2026
0.10.17-foucault 87 9/18/2026
0.10.16 87 9/16/2026
0.10.16-hamilton 80 9/14/2026
0.10.16-gauss 84 9/14/2026
0.10.16-faraday 95 9/9/2026
0.10.15 95 9/7/2026
0.10.15-euler 86 9/7/2026
0.10.14 102 9/6/2026
0.10.14-dedekind 106 9/6/2026
0.10.14-cauchy 101 9/5/2026
0.10.14-boltzmann 93 9/5/2026
0.10.13 104 9/3/2026
0.10.13-abel 92 9/3/2026
0.10.12 89 9/3/2026
0.10.11 99 8/26/2026
0.10.10 126 7/28/2026
Loading failed