PiwiTests.Instrumentation.Serilog 0.40.0

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

PiwiTests.Instrumentation.Serilog

A Serilog sink for Piwi Dashboard. WriteTo.PiwiTestLogs() feeds Warning, Error and Fatal events into the per-request capture that PiwiTests.Instrumentation.AspNetCore sends back to your Playwright tests on the X-Piwi-Logs response header.

Use it when your app logs through Serilog. With Serilog's default writeToProviders: false, Microsoft.Extensions.Logging providers are never called, so the provider AddPiwiTestLogs() registers captures nothing on its own.

Installation

dotnet add package PiwiTests.Instrumentation.AspNetCore
dotnet add package PiwiTests.Instrumentation.Serilog

This package depends on Serilog and PiwiTests.Instrumentation.Core only, not on ASP.NET Core. The middleware that writes the header comes from the ASP.NET Core package.

Usage

// Serilog configuration
loggerConfiguration.WriteTo.PiwiTestLogs();

// Startup.Configure(IApplicationBuilder app, IHostEnvironment env)
app.UsePiwiTestLogs(env, e => e.IsDevelopment() || e.IsEnvironment("Podman") || e.IsEnvironment("Integration"));

Register the sink unconditionally. It does nothing outside a request the middleware brackets, so the middleware's environment gate is the only one you need. See Choosing the environments for the ways to set it.

Serilog level Captured as
Verbose, Debug, Information Not captured
Warning Warning
Error Error
Fatal Critical

The category is the event's SourceContext (set by ForContext<T>() and by Serilog's Microsoft.Extensions.Logging bridge), and the message is the rendered template. restrictedToMinimumLevel can raise the floor, e.g. WriteTo.PiwiTestLogs(LogEventLevel.Error); capture never goes below Warning, whatever it is set to.

Requirements

  • .NET 8, 9, or 10
  • Serilog 3.1.1 or later

License

MIT

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 is compatible.  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 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.40.0 0 9/27/2026
0.39.0 39 9/26/2026