RA.Utilities.Logging.Shared 10.0.2

Prefix Reserved
dotnet add package RA.Utilities.Logging.Shared --version 10.0.2
                    
NuGet\Install-Package RA.Utilities.Logging.Shared -Version 10.0.2
                    
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="RA.Utilities.Logging.Shared" Version="10.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RA.Utilities.Logging.Shared" Version="10.0.2" />
                    
Directory.Packages.props
<PackageReference Include="RA.Utilities.Logging.Shared" />
                    
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 RA.Utilities.Logging.Shared --version 10.0.2
                    
#r "nuget: RA.Utilities.Logging.Shared, 10.0.2"
                    
#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 RA.Utilities.Logging.Shared@10.0.2
                    
#: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=RA.Utilities.Logging.Shared&version=10.0.2
                    
Install as a Cake Addin
#tool nuget:?package=RA.Utilities.Logging.Shared&version=10.0.2
                    
Install as a Cake Tool

RA.Utilities.Logging.Shared

NuGet version NuGet Downloads Codecov GitHub license Documentation

RA.Utilities.Logging.Shared provides shared components and abstractions for logging HTTP requests and responses within the RA.Utilities ecosystem. This package contains core models and helpers used by other logging libraries, such as RA.Utilities.Api.Middlewares, to ensure a consistent approach to capturing and structuring diagnostic information for HTTP calls.

📚 Table of Contents

  • Purpose
  • Installation
  • Core Components
  • Contributing

Purpose

This package is a foundational library and is not intended for direct use in most applications. Its primary role is to provide a common set of data structures (models) that other RA.Utilities packages can rely on for logging HTTP traffic.

By centralizing these models, we ensure that any middleware or service that logs HTTP requests and responses does so in a consistent, structured format.

🛠️ Installation

While you typically won't need to install this package directly, it is available on NuGet. It will be included automatically when you install a dependent package like RA.Utilities.Api.Middlewares.

dotnet add package RA.Utilities.Logging.Shared

Core Components

This package provides the data models used to structure log information for HTTP interactions.

BaseHttpLogTemplate

public class BaseHttpLogTemplate

Base class containing HTTP request/response properties for logging. Both HttpRequestLogTemplate and HttpResponseLogTemplate inherit from this class.

Properties
Name Type Required Description
RequestId string false The value of the x-request-id header from the HTTP request. Provides end-to-end correlation across services.
TraceIdentifier string false Unique identifier to represent this request in trace logs. Value of HttpContext.TraceIdentifier.
Path string false The URI used by the request message.
RequestedOn DateTime false The date and time the request was made, in UTC. Defaults to DateTime.UtcNow when the instance is created.
RemoteAddress string false The host name requested. This is usually the DNS host name or IP address of the server.

HttpRequestLogTemplate

Model for logging HTTP request.

public class HttpRequestLogTemplate : BaseHttpLogTemplate

HttpRequestLogTemplate inherits from BaseHttpLogTemplate so it will have all properties of the BaseHttpLogTemplate class.

Name Type Required Description
Scheme string false The URI scheme used by the request message (e.g., "http", "https").
Method string false The HTTP method used by the request message.
Host string false The host name used by the request message. This is usually the DNS host name or IP address of the server.
QueryString string false The query string used by the request message.
RequestHeaders IDictionary<string, string> false Collection of HTTP request headers used by the request message.
RequestBody object false HTTP request body.

HttpResponseLogTemplate

Model for logging HTTP response.

public class HttpResponseLogTemplate : BaseHttpLogTemplate

HttpResponseLogTemplate inherits from BaseHttpLogTemplate so it will have all properties of the BaseHttpLogTemplate class.

Name Type Required Description
StatusCode int? false The status code of the HTTP response.
ResponseHeaders IDictionary<string, string> false Collection of HTTP response headers.
ResponseBody object false HTTP response body.
Duration double? false The total time taken to process the request and generate the response, in milliseconds.

Contributing

Contributions are welcome! If you have a suggestion or find a bug, please open an issue to discuss it. Please follow the contribution guidelines outlined in the other RA.Utilities packages.

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.
  • net10.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on RA.Utilities.Logging.Shared:

Package Downloads
RA.Utilities.Api

Provides a collection of essential utilities for building robust and consistent ASP.NET Core APIs. This package includes endpoint registration helpers, standardized response models, and exception handling middleware to streamline development and promote best practices.

RA.Utilities.Api.Middlewares

RA.Utilities.Api.Middlewares provides a simple and efficient ASP.NET Core middleware for logging HTTP request and response details. It's designed to be easy to integrate, configurable, and performant, using Microsoft.IO.RecyclableMemoryStream to minimize memory allocations and improve application performance.

RA.Utilities.Integrations

A utility library to simplify and standardize HTTP client calls in .NET applications. It builds upon `IHttpClientFactory` to provide a structured way to configure and use typed HTTP clients for various integrations.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.2 202 10/10/2026
10.0.1 137 9/28/2026
10.0.0 318 11/23/2025
10.0.0-rc.2 234 10/30/2025