serilog-sinks-elasticsearch icon indicating copy to clipboard operation
serilog-sinks-elasticsearch copied to clipboard

FailureSink change

Open zewar96 opened this issue 4 years ago • 2 comments

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

zewar96 avatar May 25 '20 14:05 zewar96

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?

mivano avatar Jul 07 '20 21:07 mivano

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

Kamil-Zakiev avatar Dec 23 '20 12:12 Kamil-Zakiev