Skip to content

Commit 299fc33

Browse files
authored
Merge pull request #12 from serilog/dev
2.1.1 Release
2 parents 42b1678 + 9a9c087 commit 299fc33

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/Serilog.Settings.AppSettings/AppSettingsLoggerConfigurationExtensions.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414

1515
using System;
16+
using System.ComponentModel;
1617
using Serilog.Configuration;
1718
using Serilog.Settings.AppSettings;
1819

@@ -23,6 +24,26 @@ namespace Serilog
2324
/// </summary>
2425
public static class AppSettingsLoggerConfigurationExtensions
2526
{
27+
/// <summary>
28+
/// Reads the &lt;appSettings&gt; element of App.config or Web.config, searching for for keys
29+
/// that look like: <code>serilog:*</code>, which are used to configure
30+
/// the logger. To add a sink, use a key like <code>serilog:write-to:File.path</code> for
31+
/// each parameter to the sink's configuration method. To add an additional assembly
32+
/// containing sinks, use <code>serilog:using</code>. To set the level use
33+
/// <code>serilog:minimum-level</code>.
34+
/// </summary>
35+
/// <param name="settingConfiguration">Logger setting configuration.</param>
36+
/// <param name="settingPrefix">Prefix to use when reading keys in appSettings. If specified the value
37+
/// will be prepended to the setting keys and followed by :, for example "myapp" will use "myapp:serilog:minumum-level. If null
38+
/// no prefix is applied.</param>
39+
/// <returns>An object allowing configuration to continue.</returns>
40+
[EditorBrowsable(EditorBrowsableState.Never)]
41+
public static LoggerConfiguration AppSettings(
42+
this LoggerSettingsConfiguration settingConfiguration, string settingPrefix = null)
43+
{
44+
return AppSettings(settingConfiguration, settingPrefix, filePath: null);
45+
}
46+
2647
/// <summary>
2748
/// Reads the &lt;appSettings&gt; element of App.config or Web.config, searching for for keys
2849
/// that look like: <code>serilog:*</code>, which are used to configure

src/Serilog.Settings.AppSettings/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{
2-
"version": "2.1.0-*",
1+
{
2+
"version": "2.1.1-*",
33
"description": "XML configuration (System.Configuration <appSettings>) support for Serilog.",
44
"authors": [ "Serilog Contributors" ],
55
"packOptions": {

0 commit comments

Comments
 (0)