1313// limitations under the License.
1414
1515using System ;
16+ using System . ComponentModel ;
1617using Serilog . Configuration ;
1718using Serilog . Settings . AppSettings ;
1819
@@ -23,6 +24,26 @@ namespace Serilog
2324 /// </summary>
2425 public static class AppSettingsLoggerConfigurationExtensions
2526 {
27+ /// <summary>
28+ /// Reads the <appSettings> 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 <appSettings> element of App.config or Web.config, searching for for keys
2849 /// that look like: <code>serilog:*</code>, which are used to configure
0 commit comments