serilog-sinks-elasticsearch
serilog-sinks-elasticsearch copied to clipboard
FailureSink change
Does this issue relate to a new feature or an existing bug?
- [ ] Bug
- [x] New Feature
What version of Serilog.Sinks.Elasticsearch is affected? Please list the related NuGet package. 8.1.0
What is the target framework and operating system? See target frameworks & net standard matrix.
- [x] netCore 2.0
- [ ] netCore 1.0
- [ ] 4.7
- [ ] 4.6.x
- [ ] 4.5.x
Please describe the current behavior? Currently LoggerConfigurationElasticSearchExtensions.cs lists FailureSink as ILogEventSink. This prevents being able to create a failover logger from appSettings.json.
Please describe the expected behavior? In looking at how Serilog.Sinks.Async works, wouldn't it make more sense to define FailoverSink as Action<LoggerSinkConfiguration> FailureSink instead so that the configuration via appSettings would work the same way?
This is how https://github.com/serilog/serilog-settings-configuration#nested-configuration-sections recommends that we use nested configurations.
Open for any other ideas on how to load the FailureSink via config, but the current implementation does not work well from configurations
A better alignment with the configuration system would be much appreciated. would be a breaking change I think, so we should bump major and document this well. Care for a PR?
I've got issues setting up a failure sink from appsettings.json since it requires a class name but I want to specify default console sink, as @zewar96 suggests