UKHO.Logging.Serilog 2.26036.3

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

UKHO.Logging.Serilog

This UKHO.Logging.Serilog package targets .NET 8 and provides some UKHO specific Enricher classes for use with with Serilog to ensure that ASP .Net Core Web API projects within UKHO are logging details in a consistent manner.

Usage

    builder.services.AddUkhoLoggingConfiguration();
    builder.services.AddUkhoLogging();

or

    builder.services.AddUkhoLogging(config => 
    {
        config.Environment = "Development";
        config.ProjectName = "Global Kittens";
        config.ServiceName = "Global Kitten Registration API";
    });

Configuration

The package can read configuration from 'appsettings.json' (or whatever source(s) your IConfiguration is configured to use):

{
  "UkhoLogging": {
    "Environment": "Development",
    "ProjectName": "Global Kittens",
    "ServiceName": "GLobal Kitten Registration API"
  }
}

The section name "UkhoLogging" is required, as are the four properties:

Environment

The name of the runtime environment, one of "Development", "Testing", or "Production".

ProjectName

The name of the overarching project.

ServiceName

The name of the specific service.

EventHubConnectionString

The connection string for the Event Hub to which log events will be sent. This contains a secret, so it must not be checked into source control. However, since the property is tagged as 'Required', you will need to provide a dummy value in your appsettings.json file and then override it with your runtime source of IConfiguration.

Effect

The package pulls in and configures Serilog and adds a number of enrichers to the logging pipeline that add UKHO required properties to log events:

  • correlation-id
  • environment
  • exception
  • level
  • message-rendered
  • project.name
  • properties
  • service.name
  • timestamp
  • trace.id
  • transaction.id
  • ukho.assembly.informational-version
  • ukho.assembly.name
  • ukho.assembly.version
  • ukho.logging.version
  • ukho.no-http-context
  • ukho.no-http-context-accessor
  • ukho.remote.ipaddress
  • ukho.request.host
  • ukho.request.method
  • ukho.request.path
  • ukho.request.querystring
  • ukho.request.scheme
  • ukho.request.user-agent

It also pulls in the Serilog Azure Event Hub sink and configures it using the EventHubConnectionString config property. This will ship your log events to the Event Hub, formatted using the Elastic Common Schema (ECS) so that they can be ingested by the UKHO ElasticCloud instance.


The UK Hydrographic Office (UKHO) supplies hydrographic information to protect lives at sea. Maintaining the confidentiality, integrity and availability of our services is paramount. Found a security bug? Please report it to us at UKHO-ITSO@gov.co.uk

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net10.0 was computed.  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
2.26036.3 87 2/5/2026
2.26036.2 91 2/5/2026
2.26035.1 88 2/4/2026
2.25300.12 185 10/27/2025
2.0.0-alpha 85 2/5/2026
1.25247.1 2,146 9/9/2025
1.24267.3 13,523 9/23/2024
1.24262.4 154 9/18/2024
1.24261.10 157 9/17/2024
1.24261.8 173 9/17/2024