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
<PackageReference Include="UKHO.Logging.Serilog" Version="2.26036.3" />
<PackageVersion Include="UKHO.Logging.Serilog" Version="2.26036.3" />
<PackageReference Include="UKHO.Logging.Serilog" />
paket add UKHO.Logging.Serilog --version 2.26036.3
#r "nuget: UKHO.Logging.Serilog, 2.26036.3"
#:package UKHO.Logging.Serilog@2.26036.3
#addin nuget:?package=UKHO.Logging.Serilog&version=2.26036.3
#tool nuget:?package=UKHO.Logging.Serilog&version=2.26036.3
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.
- This repository overview
- Installation Guide
- Setting up your project to use Serilog
- Enrichers Details
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 | Versions 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. |
-
net8.0
- Azure.Messaging.EventHubs (>= 5.12.2)
- Elastic.Apm.NetCoreAll (>= 1.34.1)
- Elastic.CommonSchema.Serilog (>= 9.0.0)
- Serilog (>= 4.3.0)
- Serilog.AspNetCore (>= 8.0.3)
- Serilog.Sinks.AzureEventHub (>= 6.0.0)
- Serilog.Sinks.Console (>= 6.0.0)
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 |