serilog-contrib / Serilog.Sinks.Postgresql.Alternative

Serilog.Sinks.Postgresql.Alternative is a library to save logging information from https://github.com/serilog/serilog to https://www.postgresql.org/.
MIT License
67 stars 13 forks source link

3.3.10 - Error if configure columns from JSON configuration #31

Closed Du57iN closed 3 years ago

Du57iN commented 3 years ago

Exception: "Cannot create instance of type 'Serilog.Sinks.PostgreSQL.ColumnWriters.SinglePropertyColumnWriter' because it is missing a public parameterless constructor."

System.InvalidOperationException at Microsoft.Extensions.Configuration.ConfigurationBinder.CreateInstance(Type type)\r\n at Microsoft.Extensions.Configuration.ConfigurationBinder.BindInstance(Type type, Object instance, IConfiguration config, BinderOptions options)\r\n at Microsoft.Extensions.Configuration.ConfigurationBinder.BindDictionary(Object dictionary, Type dictionaryType, IConfiguration config, BinderOptions options)\r\n at Microsoft.Extensions.Configuration.ConfigurationBinder.AttemptBindToCollectionInterfaces(Type type, IConfiguration config, BinderOptions options)\r\n at Microsoft.Extensions.Configuration.ConfigurationBinder.BindInstance(Type type, Object instance, IConfiguration config, BinderOptions options)\r\n at Microsoft.Extensions.Configuration.ConfigurationBinder.Get(IConfiguration configuration, Type type, Action1 configureOptions)\r\n at Microsoft.Extensions.Configuration.ConfigurationBinder.Get(IConfiguration configuration, Type type)\r\n at Serilog.Settings.Configuration.ObjectArgumentValue.ConvertTo(Type toType, ResolutionContext resolutionContext)\r\n at Serilog.Settings.Configuration.ConfigurationReader.<>c__DisplayClass18_2.<CallConfigurationMethods>b__3(<>f__AnonymousType92 <>hTransparentIdentifier0)\r\n at System.Linq.Utilities.<>cDisplayClass2_03.<CombineSelectors>b__0(TSource x)\r\n at System.Linq.Enumerable.SelectListPartitionIterator2.ToList()\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)\r\n at Serilog.Settings.Configuration.ConfigurationReader.CallConfigurationMethods(ILookup2 methods, IList`1 configurationMethods, Object receiver)\r\n at Serilog.Settings.Configuration.ConfigurationReader.ApplySinks(LoggerConfiguration loggerConfiguration)\r\n at Serilog.Settings.Configuration.ConfigurationReader.Configure(LoggerConfiguration loggerConfiguration)\r\n at Serilog.Configuration.LoggerSettingsConfiguration.Settings(ILoggerSettings settings)\r\n at Serilog.ConfigurationLoggerConfigurationExtensions.Configuration(LoggerSettingsConfiguration settingConfiguration, IConfiguration configuration, String sectionName, DependencyContext dependencyContext)\r\n at Serilog.ConfigurationLoggerConfigurationExtensions.Configuration(LoggerSettingsConfiguration settingConfiguration, IConfiguration configuration, DependencyContext dependencyContext)\r\n at MyDox.WebApp.Program.<>c.b__1_1(HostBuilderContext context, IServiceProvider services, LoggerConfiguration configuration) ...

SeppPenner commented 3 years ago

Ah, I see. This was an error introduced with the sorting functionality, I guess. I will try to provide a fix soon.

SeppPenner commented 3 years ago

Version 3.3.11 fixes this. Can you verify that it works, please?

Du57iN commented 3 years ago

Yes, it;s working in 3.3.11 Thank you