VOOZH about

URL: https://www.nuget.org/packages/serilog.settings.appsettings

⇱ NuGet Gallery | Serilog.Settings.AppSettings 3.0.0




👁 Image
Serilog.Settings.AppSettings 3.0.0

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

Serilog.Settings.AppSettings 👁 Build status
👁 NuGet Version
👁 Join the chat at https://gitter.im/serilog/serilog

An XML <appSettings> reader for Serilog.

Getting started

The <appSettings> support package needs to be installed from NuGet:

Install-Package Serilog.Settings.AppSettings

To read configuration from <appSettings> use the ReadFrom.AppSettings() extension method on your LoggerConfiguration:

Log.Logger = new LoggerConfiguration()
 .ReadFrom.AppSettings()
 ... // Other configuration here, then
 .CreateLogger()

You can mix and match XML and code-based configuration, but each sink must be configured either using XML or in code - sinks added in code can't be modified via app settings.

Configuration syntax

To configure the logger, an <appSettings> element should be included in the program's App.config or Web.config file.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <appSettings>
 <add key="serilog:minimum-level" value="Verbose" />
 

Serilog settings are prefixed with serilog:.

Setting the minimum level

To set the logging level for the app use the serilog:minimum-level setting key.

 <add key="serilog:minimum-level" value="Verbose" />

Valid values are those defined in the LogEventLevel enumeration: Verbose, Debug, Information, Warning, Error, Fatal.

Adding a sink

Sinks are added with the serilog:write-to key. The setting name matches the configuration method name that you'd use in code, so the following are equivalent:

 .WriteTo.Console()

In XML:

 <add key="serilog:write-to:Console" />

NOTE: When using serilog:* keys need to be unique.

Sink assemblies must be specified using the serilog:using syntax. For example, to configure

<add key="serilog:using:Console" value="Serilog.Sinks.Console" />
<add key="serilog:write-to:Console"/>

If the sink accepts parameters, these are specified by appending the parameter name to the setting.

 .WriteTo.File(@"C:\Logs\myapp-{Date}.txt", retainedFileCountLimit: 10)

In XML:

 <add key="serilog:write-to:File.path" value="C:\Logs\myapp-{Date}.txt" />
 <add key="serilog:write-to:File.retainedFileCountLimit" value="10" />

Any environment variables specified in a setting value (e.g. %TEMP%) will be expanded appropriately when read.

Using sink extensions from additional assemblies

To use sinks and enrichers from additional assemblies, specify them with a serilog:using key.

For example, to use configuration from the Serilog.Sinks.EventLog assembly:

 <add key="serilog:using:EventLog" value="Serilog.Sinks.EventLog" />
 <add key="serilog:write-to:EventLog.source" value="Serilog Demo" />

Enriching with properties

To attach additional properties to log events, specify them with the serilog:enrich:with-property directive.

For example, to add the property Release with the value "1.2-develop" to all events:

 <add key="serilog:enrich:with-property:Release" value="1.2-develop" />

Adding minimum level overrides

Since Serilog 2.1, minimum level overrides can be added to change the minimum level for some specific namespaces. This is done with the setting key serilog:minimum-level:override: followed by the source context prefix.

For instance, the following are equivalent :

Log.Logger = new LoggerConfiguration()
 .MinimumLevel.Information()
 .MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
 .MinimumLevel.Override("Microsoft.AspNetCore.Mvc", LogEventLevel.Error)

and in XML

 <add key="serilog:minimum-level" value="Information" />
 <add key="serilog:minimum-level:override:Microsoft" value="Warning" />
 <add key="serilog:minimum-level:override:Microsoft.AspNetCore.Mvc" value="Error" />

Filtering

Filters can be specified using the Serilog.Filters.Expressions package; see the README there for more information.

Setting values from enumerations

When configuring sink settings with values from enumerations, use the member name, without specifying the name of the enumeration.

For example, to configure the RollingInterval of the File Sink to create a new log file per day, use Day instead of RollingInterval.Day:

 <add key="serilog:write-to:File.rollingInterval" value="Day"/>

If you specify the the name of the enumeration, you'll receive an error similar to System.ArgumentException: Requested value 'RollingInterval.Day' was not found

Destructuring


LoggerConfiguration
 .Destructure.ToMaximumDepth(maximumDestructuringDepth: 3)
 .Destructure.ToMaximumStringLength(maximumStringLength: 3)
 .Destructure.ToMaximumCollectionCount(maximumCollectionCount: 3)
 .Destructure.AsScalar(typeof(System.Version))
 .Destructure.With(new CustomPolicy());

and in XML

<add key="serilog:destructure:ToMaximumDepth.maximumDestructuringDepth" value="3" />
<add key="serilog:destructure:ToMaximumStringLength.maximumStringLength" value="3" />
<add key="serilog:destructure:ToMaximumCollectionCount.maximumCollectionCount" value="3" />
<add key="serilog:destructure:AsScalar.scalarType" value="System.Version" />
<add key="serilog:destructure:With.policy" value="My.CustomPolicy, MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
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 (57)

Showing the top 5 NuGet packages that depend on Serilog.Settings.AppSettings:

Package Downloads
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.

Ingeniux_InSite_Search_2

Nuget Package for Ingeniux InSite Search V2

CertiPay.Common

Package Description

UnderTest

Opinionated acceptance testing framework.

Hexalith.Infrastructure.WebApis

Hexalith is a set of libraries to build a micro-service architecture.

GitHub repositories (9)

Showing the top 9 popular GitHub repositories that depend on Serilog.Settings.AppSettings:

Repository Stars
win-acme/win-acme
Automate SSL/TLS certificates on Windows with ease
jakubgarfield/Bonobo-Git-Server
Bonobo Git Server for Windows is a web application you can install on your IIS and easily manage and connect to your git repositories. Go to homepage for release and more info.
DaxStudio/DaxStudio
DAX Studio is a tool to write, execute, and analyze DAX queries in Power BI Desktop, Power Pivot for Excel, and Analysis Services Tabular.
EvilBeaver/OneScript
Исполняющая среда скриптов на языке 1С
simple-acme/simple-acme
A simple cross platform ACME client (for use with Let's Encrypt et al.)
rzander/ruckzuck
software package manager for windows
ProjectCeleste/Celeste.Launcher
luoyunchong/dotnetcore-examples
about learning DotNetCore via examples. DotNetCore 教程、技术栈示例代码,快速简单上手教程。
Shazwazza/UmbracoIdentity
ASP.NET Identity implementation for Umbraco's native member data
Version Downloads Last Updated
3.0.0 3,462,336 7/4/2024
3.0.0-dev-00080 314 7/3/2024
2.2.3-dev-00066 118,588 2/1/2021
2.2.3-dev-00063 24,162 5/10/2020
2.2.2 33,952,263 10/26/2018
2.2.2-dev-00059 1,929 10/26/2018
2.2.1-dev-00056 2,007 10/8/2018
2.2.1-dev-00054 2,367 9/22/2018
2.2.1-dev-00052 4,291 5/9/2018
2.2.0-dev-00048 3,027 3/29/2018
2.2.0-dev-00041 2,290 3/28/2018
2.1.2 2,971,890 9/19/2017
2.1.2-dev-00022 2,096 9/19/2017
2.1.1 37,515 9/18/2017
2.1.1-dev-00018 2,188 9/14/2017
2.1.0 783,619 2/14/2017
2.1.0-dev-00014 5,337 8/17/2016
2.1.0-dev-00013 2,184 8/17/2016
2.0.0 860,158 6/29/2016
Loading failed