VOOZH about

URL: https://www.nuget.org/packages/serilog.sinks.map

⇱ NuGet Gallery | Serilog.Sinks.Map 2.0.0




👁 Image
Serilog.Sinks.Map 2.0.0

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

Serilog.Sinks.Map 👁 Build status
👁 NuGet Pre Release

A Serilog sink wrapper that dispatches events based on a property value.

Getting started

Install the package from NuGet:

dotnet add package Serilog.Sinks.Map

The WriteTo.Map() method accepts a property name to use as a sink selector, a default value to use when the property is not attached, and a function that configures the sinks based on each property value.

For example, when using Serilog.Sinks.File:

dotnet add package Serilog.Sinks.File

The value of a log event property like Name can be inserted into log filenames:

Log.Logger = new LoggerConfiguration()
 .WriteTo.Map("Name", "Other", (name, wt) => wt.File($"./logs/log-{name}.txt"))
 .CreateLogger();

Log.Information("Hello, {Name}!", "Alice");
// -> Event written to log-Alice.txt

Log.Information("Hello, {Name}!", "Bob");
// -> Event written to log-Bob.txt

Log.Information("Shutting down");
// -> Event written to log-Other.txt

Log.CloseAndFlush();

Limiting the number of open sinks

By default, the target sinks opened by this sink won't be closed/disposed until the mapped sink is. This is efficient for dispatching to a finite number of sinks, e.g. file-per-log-level and so-on, but isn't suitable when the set of possible key values is open-ended.

To limit the number of target sinks that will be kept open in the map, specify sinkMapCountLimit:

 .WriteTo.Map("Name",
 "Other",
 (name, wt) => wt.File($"./logs/log-{name}.txt"),
 sinkMapCountLimit: 10)

To keep no sinks open, i.e. close them immediately after processing each event, a sinkMapCountLimit of zero may be specified.

Configuration with <appSettings> and appSettings.json

Serilog.Sinks.Map is built around a mapping function, and as such, isn't able to be configured using XML or JSON configuration.

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 (67)

Showing the top 5 NuGet packages that depend on Serilog.Sinks.Map:

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.

UmbracoCms.Core

Contains the core assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms package to setup Umbraco in Visual Studio as an ASP.NET project.

GitHub repositories (13)

Showing the top 13 popular GitHub repositories that depend on Serilog.Sinks.Map:

Repository Stars
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.
umbraco/Umbraco-CMS
Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
GitTools/GitVersion
From git log to SemVer in no time
SubnauticaNitrox/Nitrox
An open-source, multiplayer modification for the game Subnautica.
microsoft/sbom-tool
The SBOM tool is a highly scalable and enterprise ready tool to create SPDX 2.2 compatible SBOMs for any variety of artifacts.
smartstore/Smartstore
A modular, scalable and ultra-fast open-source all-in-one eCommerce platform built on ASP.NET Core 10
microsoft/component-detection
Scans your project to determine what components you use
connamara/quickfixn
QuickFIX/n implements the FIX protocol on .NET.
Mutagen-Modding/Synthesis
A patcher pipeline framework and GUI. Run collections of code-based mods to create content customized for your load order
serilog-contrib/serilog-ui
Simple Serilog log viewer UI for several sinks.
StarEliteCore/Nebula.Admin
Destiny.Core.Flow是基于.Net Core,VUE前后分离,开发的一个开源Admin管理框架目前有以下模块:菜单管理、用户管理、角色管理、用户角色、角色权限等功能。
Papela/Nitrox-Cracked-Mod
An open-source, multiplayer modification for the game Subnautica (Cracked).
Yomalex/MuEmu
C# MuOnline Server Implementation for support multiple client version now aims to Season 16 Kor
Version Downloads Last Updated
2.0.0 3,895,350 7/11/2024
2.0.0-dev-00048 244 7/10/2024
1.0.2 13,508,058 12/1/2020
1.0.2-dev-00040 616 12/1/2020
1.0.2-dev-00031 1,740 4/17/2020
1.0.1 350,527 2/19/2020
1.0.1-dev-00028 738 2/13/2020
1.0.1-dev-00025 5,702 5/2/2019
1.0.0 1,232,323 4/21/2019
1.0.0-dev-00020 913 4/21/2019
1.0.0-dev-00017 32,328 9/23/2018
1.0.0-dev-00012 5,232 10/28/2017
1.0.0-dev-00008 1,320 10/26/2017
1.0.0-dev-00006 1,296 10/26/2017
1.0.0-dev-00004 1,300 10/24/2017
1.0.0-dev-00001 1,498 6/6/2017