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

BufferRetainedInvalidPayloadsLimitBytes setting is ignored in appsettings

Open gitmln opened this issue 5 years ago • 0 comments
trafficstars

A few questions before you begin:

Is this an issue related to the Serilog core project or one of the sinks or community projects.
This issue list is intended for Serilog Elasticsearch Sink issues. If this issue relates to another sink or to the code project, please log on the related repository. Please use Gitter chat and Stack Overflow for discussions and questons.

Does this issue relate to a new feature or an existing bug?

  • [x] Bug
  • [ ] New Feature

What version of Serilog.Sinks.Elasticsearch is affected? Please list the related NuGet package. Tested 8.1.0 (but it's there since v7.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? PR #205 introduced BufferRetainedInvalidPayloadsLimitBytes - A soft limit for the number of bytes to use for storing failed requests. Even though it is documented in the README (xml and json appSettings reader "bufferRetainedInvalidPayloadsLimitBytes": 5000,) this setting is missing from the Elasticsearch constructor:

https://github.com/serilog/serilog-sinks-elasticsearch/blob/1cf2748b7a85fdd95b2c863ed7d5c54a2252a78c/src/Serilog.Sinks.Elasticsearch/LoggerConfigurationElasticSearchExtensions.cs#L148

so it's ignored and can be only set in code https://github.com/serilog/serilog-sinks-elasticsearch/blob/4f3a7abbbde7321f600fa193e39a170bb9b5832f/sample/Serilog.Sinks.Elasticsearch.Sample/Program.cs#L116

Please describe the expected behavior? BufferRetainedInvalidPayloadsLimitBytes can be used in appsettings to automatically set the appropriate sink setting.

gitmln avatar Jul 29 '20 09:07 gitmln