diff --git a/.gitignore b/.gitignore
index 29e6b22..c90bd95 100644
--- a/.gitignore
+++ b/.gitignore
@@ -132,7 +132,7 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
-# TODO: Comment the next line if you want to checkin your web deploy settings
+# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
@@ -200,7 +200,4 @@ FakesAssemblies/
project.lock.json
-#Test files
-*.txt
-
artifacts/
diff --git a/test/Serilog.Settings.Configuration.Tests/ApiApprovalTests.cs b/test/Serilog.Settings.Configuration.Tests/ApiApprovalTests.cs
new file mode 100644
index 0000000..08bf7f4
--- /dev/null
+++ b/test/Serilog.Settings.Configuration.Tests/ApiApprovalTests.cs
@@ -0,0 +1,25 @@
+#if NET7_0
+
+using PublicApiGenerator;
+using Shouldly;
+
+namespace Serilog.Settings.Configuration.Tests;
+
+public class ApiApprovalTests
+{
+ [Fact]
+ public void PublicApi_Should_Not_Change_Unintentionally()
+ {
+ var assembly = typeof(ConfigurationReaderOptions).Assembly;
+ var publicApi = assembly.GeneratePublicApi(
+ new()
+ {
+ IncludeAssemblyAttributes = false,
+ ExcludeAttributes = new[] { "System.Diagnostics.DebuggerDisplayAttribute" },
+ });
+
+ publicApi.ShouldMatchApproved(options => options.WithFilenameGenerator((_, _, fileType, fileExtension) => $"{assembly.GetName().Name!}.{fileType}.{fileExtension}"));
+ }
+}
+
+#endif
diff --git a/test/Serilog.Settings.Configuration.Tests/Serilog.Settings.Configuration.Tests.csproj b/test/Serilog.Settings.Configuration.Tests/Serilog.Settings.Configuration.Tests.csproj
index 5836bfb..246d976 100644
--- a/test/Serilog.Settings.Configuration.Tests/Serilog.Settings.Configuration.Tests.csproj
+++ b/test/Serilog.Settings.Configuration.Tests/Serilog.Settings.Configuration.Tests.csproj
@@ -19,10 +19,11 @@
-
+
+
diff --git a/test/Serilog.Settings.Configuration.Tests/Serilog.Settings.Configuration.approved.txt b/test/Serilog.Settings.Configuration.Tests/Serilog.Settings.Configuration.approved.txt
new file mode 100644
index 0000000..912f171
--- /dev/null
+++ b/test/Serilog.Settings.Configuration.Tests/Serilog.Settings.Configuration.approved.txt
@@ -0,0 +1,50 @@
+namespace Serilog
+{
+ public static class ConfigurationLoggerConfigurationExtensions
+ {
+ public const string DefaultSectionName = "Serilog";
+ [System.Obsolete("Use ReadFrom.Configuration(IConfiguration configuration, ConfigurationReaderOptio" +
+ "ns readerOptions) instead.")]
+ public static Serilog.LoggerConfiguration Configuration(this Serilog.Configuration.LoggerSettingsConfiguration settingConfiguration, Microsoft.Extensions.Configuration.IConfiguration configuration, Microsoft.Extensions.DependencyModel.DependencyContext dependencyContext) { }
+ [System.Obsolete("Use ReadFrom.Configuration(IConfiguration configuration, ConfigurationReaderOptio" +
+ "ns readerOptions) instead.")]
+ public static Serilog.LoggerConfiguration Configuration(this Serilog.Configuration.LoggerSettingsConfiguration settingConfiguration, Microsoft.Extensions.Configuration.IConfiguration configuration, Serilog.Settings.Configuration.ConfigurationAssemblySource configurationAssemblySource) { }
+ public static Serilog.LoggerConfiguration Configuration(this Serilog.Configuration.LoggerSettingsConfiguration settingConfiguration, Microsoft.Extensions.Configuration.IConfiguration configuration, Serilog.Settings.Configuration.ConfigurationReaderOptions readerOptions = null) { }
+ [System.Obsolete("Use ReadFrom.Configuration(IConfiguration configuration, ConfigurationReaderOptio" +
+ "ns readerOptions) instead.")]
+ public static Serilog.LoggerConfiguration Configuration(this Serilog.Configuration.LoggerSettingsConfiguration settingConfiguration, Microsoft.Extensions.Configuration.IConfiguration configuration, params System.Reflection.Assembly[] assemblies) { }
+ [System.Obsolete("Use ReadFrom.Configuration(IConfiguration configuration, ConfigurationReaderOptio" +
+ "ns readerOptions) instead.")]
+ public static Serilog.LoggerConfiguration Configuration(this Serilog.Configuration.LoggerSettingsConfiguration settingConfiguration, Microsoft.Extensions.Configuration.IConfiguration configuration, string sectionName, Microsoft.Extensions.DependencyModel.DependencyContext dependencyContext = null) { }
+ [System.Obsolete("Use ReadFrom.Configuration(IConfiguration configuration, ConfigurationReaderOptio" +
+ "ns readerOptions) instead.")]
+ public static Serilog.LoggerConfiguration Configuration(this Serilog.Configuration.LoggerSettingsConfiguration settingConfiguration, Microsoft.Extensions.Configuration.IConfiguration configuration, string sectionName, Serilog.Settings.Configuration.ConfigurationAssemblySource configurationAssemblySource) { }
+ [System.Obsolete("Use ReadFrom.Configuration(IConfiguration configuration, ConfigurationReaderOptio" +
+ "ns readerOptions) instead.")]
+ public static Serilog.LoggerConfiguration Configuration(this Serilog.Configuration.LoggerSettingsConfiguration settingConfiguration, Microsoft.Extensions.Configuration.IConfiguration configuration, string sectionName, params System.Reflection.Assembly[] assemblies) { }
+ [System.Obsolete("Use ReadFrom.Configuration(IConfiguration configuration, string sectionName, Depe" +
+ "ndencyContext dependencyContext) instead.")]
+ public static Serilog.LoggerConfiguration ConfigurationSection(this Serilog.Configuration.LoggerSettingsConfiguration settingConfiguration, Microsoft.Extensions.Configuration.IConfigurationSection configSection, Microsoft.Extensions.DependencyModel.DependencyContext dependencyContext = null) { }
+ [System.Obsolete("Use ReadFrom.Configuration(IConfiguration configuration, string sectionName, Conf" +
+ "igurationAssemblySource configurationAssemblySource) instead.")]
+ public static Serilog.LoggerConfiguration ConfigurationSection(this Serilog.Configuration.LoggerSettingsConfiguration settingConfiguration, Microsoft.Extensions.Configuration.IConfigurationSection configSection, Serilog.Settings.Configuration.ConfigurationAssemblySource configurationAssemblySource) { }
+ }
+}
+namespace Serilog.Settings.Configuration
+{
+ public enum ConfigurationAssemblySource
+ {
+ UseLoadedAssemblies = 0,
+ AlwaysScanDllFiles = 1,
+ }
+ public sealed class ConfigurationReaderOptions
+ {
+ public ConfigurationReaderOptions() { }
+ public ConfigurationReaderOptions(Microsoft.Extensions.DependencyModel.DependencyContext dependencyContext) { }
+ public ConfigurationReaderOptions(Serilog.Settings.Configuration.ConfigurationAssemblySource configurationAssemblySource) { }
+ public ConfigurationReaderOptions(params System.Reflection.Assembly[] assemblies) { }
+ public System.IFormatProvider FormatProvider { get; init; }
+ public System.Action OnLevelSwitchCreated { get; init; }
+ public string SectionName { get; init; }
+ }
+}
\ No newline at end of file