EMH.Lib.Patterns.HippoLog.SerilogAdapter 3.1.202

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

๐Ÿ“ HippoLog ยท Serilog Adapter

A HippoLog ILogAdapter that sends every HippoLog call to Serilog's static Log logger.

.NET Standard Serilog NuGet


โœจ What it does

HippoLog Core defines a logging interface, ILogAdapter. This package implements it with Serilog. Create it at the host level, then hand it to HippoLog.

flowchart LR
    APP["Your code"]
    HL["HippoLog<br/>(HippoLog Core)"]
    AD["SerilogAdapter"]
    LOG["Serilog static Log.Logger"]
    SINKS["Your Serilog sinks"]

    APP --> HL --> AD --> LOG --> SINKS
Type Purpose
SerilogAdapterFactory.Create() Returns the adapter. It is a lazy singleton, so every call returns the same instance.
Logic.SerilogAdapter Maps LogVerbose, LogDebug, LogInformation, LogWarning, LogError and LogFatal (with or without an exception, with 0โ€“3 typed values or a params array) to the matching Log.* call.

The adapter writes to Serilog's global Log.Logger. It does no configuration of its own. Set up Log.Logger first, or nothing gets written.


๐Ÿ“ฆ Using this package

Package ID: EMH.Lib.Patterns.HippoLog.SerilogAdapter. It is published to the private Email Hippo NuGet feed.

Install-Package EMH.Lib.Patterns.HippoLog.SerilogAdapter

Set up Serilog as normal:

Log.Logger = new LoggerConfiguration()
    .Enrich.FromLogContext()
    .WriteTo.Console()
    .MinimumLevel.Debug()
    .CreateLogger();

Then set up HippoLog with the Serilog adapter:

ILogAdapter serilogAdapter = SerilogAdapterFactory.Create();

HippoLog.Initialize(serilogAdapter);

HippoLog.LogVerbose("I work!");

Messages are Serilog message templates. See the Serilog docs for the format.


๐Ÿš€ Quick start

Prerequisites

  • .NET 10 SDK (CI uses mcr.microsoft.com/dotnet/sdk:10.0)
  • Access to the private Email Hippo NuGet feed, for EMH.Lib.Patterns.HippoLog.Core

Build and test

cd src
dotnet build
dotnet test

๐Ÿงช Testing

Suite Location Framework Needs
Unit src/Tests/EMH.Lib.Patterns.HippoLog.SerilogAdapter.Tests NUnit + FluentAssertions, net10.0 Nothing

Tests capture log events with Serilog.Sinks.TestCorrelator. There is one test so far: DebugTests checks that LogDebug writes one Debug event with the right template.


๐Ÿ—‚๏ธ Project layout

src/
โ”œโ”€โ”€ Component/EMH.Lib.Patterns.HippoLog.Serilog/       The package (netstandard2.0)
โ”‚   โ”œโ”€โ”€ SerilogAdapterFactory.cs                       Public entry point
โ”‚   โ””โ”€โ”€ Logic/SerilogAdapter.cs                        ILogAdapter โ†’ Serilog Log.*
โ”œโ”€โ”€ Tests/EMH.Lib.Patterns.HippoLog.SerilogAdapter.Tests/   NUnit tests (net10.0)
โ””โ”€โ”€ EMH.Lib.Patterns.HippoLog.SerilogAdapter.sln
bitbucket-pipelines.yml

Note that the project folder is EMH.Lib.Patterns.HippoLog.Serilog but the project file and package are ...SerilogAdapter.


๐Ÿ” CI/CD

Bitbucket Pipelines (bitbucket-pipelines.yml), on the mcr.microsoft.com/dotnet/sdk:10.0 image:

  1. Other branches. Restore, Release build, Release tests.
  2. master. The same, then dotnet pack and dotnet nuget push to the feed in GLOBAL_NUGET_FEED_URL, using the key in GLOBAL_NUGET_KEY_EMAILHIPPO_LTD.

The package version is ${BUILD_VERSION_PREFIX}.${BITBUCKET_BUILD_NUMBER}, set in the pipeline. Every green master build publishes a new version.


๐Ÿ”— See also


<sub>ยฉ Email Hippo Ltd</sub>

Product 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.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
3.1.202 0 11/28/2026
3.1.200 1,129 11/20/2026
3.1.196 4,049 10/14/2026
3.1.195 429 10/10/2026
3.1.194 1,213 9/28/2026
3.1.193 1,368 9/16/2026
3.1.192 204 9/15/2026
3.1.191 490 9/10/2026
3.1.190 814 8/28/2026
3.1.189 611 8/25/2026
3.1.188 1,519 8/15/2026
1.1.187 2,228 7/15/2026
1.1.186 604 7/11/2026
1.1.185 876 6/24/2026
1.1.184 2,217 5/27/2026
1.1.183 639 5/20/2026
1.1.182 684 5/13/2026
1.1.181 760 5/4/2026
1.1.180 438 4/29/2026
1.1.179 1,923 4/8/2026
Loading failed

Updated packages.