VOOZH about

URL: https://www.nuget.org/packages/Serilog.Enrichers.Thread/

⇱ NuGet Gallery | Serilog.Enrichers.Thread 4.0.0




👁 Image
Serilog.Enrichers.Thread 4.0.0

Prefix Reserved
dotnet add package Serilog.Enrichers.Thread --version 4.0.0
 
 
NuGet\Install-Package Serilog.Enrichers.Thread -Version 4.0.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="Serilog.Enrichers.Thread" Version="4.0.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Serilog.Enrichers.Thread" Version="4.0.0" />
 
Directory.Packages.props
<PackageReference Include="Serilog.Enrichers.Thread" />
 
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 Serilog.Enrichers.Thread --version 4.0.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Serilog.Enrichers.Thread, 4.0.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 Serilog.Enrichers.Thread@4.0.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=Serilog.Enrichers.Thread&version=4.0.0
 
Install as a Cake Addin
#tool nuget:?package=Serilog.Enrichers.Thread&version=4.0.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Serilog.Enrichers.Thread 👁 Build status
👁 NuGet Version

Enrich Serilog events with properties from the current thread.

Getting started

Install the package from NuGet:

Install-Package Serilog.Enrichers.Thread

In your logger configuration, apply Enrich.WithThreadId() and Enrich.WithThreadName():

Log.Logger = new LoggerConfiguration()
 .Enrich.WithThreadId()
 .Enrich.WithThreadName()
 .CreateLogger();

Many sinks simply include all properties without further action required, so the thread id will be logged automatically. However, some sinks, such as the File and Console sinks use an output template and the new ThreadId may not be automatically output in your sink. In this case, in order for the ThreadId or ThreadName to show up in the logging, you will need to create or modify your output template.

w.File(...., outputTemplate:
 "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj} {Properties}{NewLine}{Exception}")

Here, {Properties} can include not only ThreadId and ThreadName, but any other enrichment which is applied. Alternatively, {ThreadId} could be used instead, if you want to only add the thread id enrichment and {ThreadName}, if you want to only add the thread name enrichment.

An example, which also uses the Serilogs.Sinks.Async Nuget package, is below:

 Thread.CurrentThread.Name = "MyWorker";
 
 var logger = Log.Logger = new LoggerConfiguration()
 .MinimumLevel.Debug()
 .WriteTo.Console(restrictedToMinimumLevel:Serilog.Events.LogEventLevel.Information)
 .WriteTo.Async(w=>w.File("..\\..\\..\\..\\logs\\SerilogLogFile.json", rollingInterval: RollingInterval.Day, outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj} <{ThreadId}><{ThreadName}>{NewLine}{Exception}"))
 .Enrich.WithThreadId()
 .CreateLogger();

Which would produce an output in the log file as follows:

2018-04-06 13:12:45.684 +02:00 [ERR] The file file_name.svg does not exist <4><MyWorker>

Where, <4> is an example thread id and <MyWorker> is an example thread name.

To use the enricher, first install the NuGet package:

Install-Package Serilog.Enrichers.Thread

Note: The {ThreadName} property will only be attached when it is not null. Otherwise it will be omitted. If you want to get this property always attached you can use the following:

using Serilog.Enrichers;

Log.Logger = new LoggerConfiguration()
 .Enrich.WithThreadName()
 .Enrich.WithProperty(ThreadNameEnricher.ThreadNamePropertyName, "MyDefault")
 .CreateLogger();

The enrichment order is important. Otherwise "MyDefault" would always win.

Copyright © 2016 Serilog Contributors - Provided under the Apache License, Version 2.0.

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 is compatible.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 is compatible.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 is compatible.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (465)

Showing the top 5 NuGet packages that depend on Serilog.Enrichers.Thread:

Package Downloads
Umbraco.Cms.Web.Common

Contains the web assembly needed to run Umbraco CMS.

Umbraco.Cms.Infrastructure

Contains the infrastructure assembly needed to run Umbraco CMS.

Umbraco.Cms.Examine.Lucene

Adds Examine searching support using Lucene to Umbraco CMS.

Umbraco.Cms.Web.Website

Contains the website assembly needed to run the frontend of Umbraco CMS.

IppDotNetSdkForQuickBooksApiV3

The IPP .NET SDK for QuickBooks V3 is a set of .NET classes that make it easier to call QuickBooks APIs. This is the .Net Standard 2.0 version of the .Net SDK

GitHub repositories (79)

Showing the top 20 popular GitHub repositories that depend on Serilog.Enrichers.Thread:

Repository Stars
jellyfin/jellyfin
The Free Software Media System - Server Backend & API
Kareadita/Kavita
Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
fullstackhero/dotnet-starter-kit
Production Grade Cloud-Ready .NET 10 Starter Kit (Web API + React Client) with Multitenancy Support, and Clean/Modular Architecture that saves roughly 200+ Development Hours! All Batteries Included.
kurrent-io/KurrentDB
KurrentDB is a database that's engineered for modern software applications and event-driven architectures. Its event-native design simplifies data modeling and preserves data integrity while the integrated streaming engine solves distributed messaging challenges and ensures data consistency.
ServiceStack/ServiceStack
Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all
umbraco/Umbraco-CMS
Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
immense/Remotely
A remote control and remote scripting solution, built with .NET 8, Blazor, and SignalR.
BililiveRecorder/BililiveRecorder
录播姬 | mikufans 生放送录制
rnwood/smtp4dev
smtp4dev - the fake smtp email server for development and testing
skoruba/IdentityServer4.Admin
The administration for the IdentityServer4 and Asp.Net Core Identity
Dotnet-Boxed/Templates
.NET project templates with batteries included, providing the minimum amount of code required to get you going faster.
AIDotNet/OpenDeepWiki
OpenDeepWiki is the open-source version of the DeepWiki project, aiming to provide a powerful knowledge management and collaboration platform. The project is mainly developed using C# and TypeScript, supporting modular design, and is easy to expand and customize.
Belphemur/SoundSwitch
C# application to switch default playing device. Download: https://soundswitch.aaflalo.me/
dotnet/macios
.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
github/VisualStudio
GitHub Extension for Visual Studio
sjdirect/abot
Cross Platform C# web crawler framework built for speed and flexibility. Please star this project! +1.
alxnbl/onenote-md-exporter
ConsoleApp to export OneNote notebooks to Markdown formats
Yu-Core/SwashbucklerDiary
侠客日记是一个开源、跨平台的本地日记app,使用Blazor开发,支持Android,Windows,macOS,Web,Linux。"SwashbucklerDiary" is an open source cross-platform local diary app using Blazor , support Android,Windows,macOS,Web,Linux.
iammukeshm/CleanArchitecture.WebApi
An implementation of Clean Architecture for ASP.NET Core 3.1 WebAPI. Built with loosely coupled architecture and clean-code practices in mind.
SteeltoeOSS/Steeltoe
.NET Components for Externalized Configuration, Database Connectors, Service Discovery, Logging and Distributed Tracing, Application Management, Security, and more.
Version Downloads Last Updated
4.0.0 56,731,481 6/14/2024
4.0.0-dev-00770 847 6/14/2024
4.0.0-dev-00767 412 6/14/2024
4.0.0-dev-00762 413 6/14/2024
3.2.0-dev-00756 418,740 11/14/2023
3.2.0-dev-00752 935,370 5/11/2021
3.2.0-dev-00750 6,004,219 2/26/2021
3.2.0-dev-00747 897,996 9/2/2019
3.1.1-dev-00745 72,300 6/2/2019
3.1.1-dev-00743 5,455 5/8/2019
3.1.0 132,002,797 5/2/2019
3.1.0-dev-00739 1,096 5/2/2019
3.0.1-dev-00737 12,003 2/24/2019
3.0.1-dev-00731 1,851 2/8/2019
3.0.1-dev-00728 34,483 5/9/2018
3.0.1-dev-00727 7,786 4/6/2018
3.0.0 11,701,489 11/13/2016
3.0.0-dev-00721 2,148 11/11/2016
2.0.1-dev-00720 1,656 11/11/2016
2.0.0 520,907 6/28/2016
Loading failed