serilog-sinks-elasticsearch
serilog-sinks-elasticsearch copied to clipboard
Log Events not Written to Sink with Inner Exceptions
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. 8.0.0
What is the target framework and operating system? See target frameworks & net standard matrix.
- [ ] netCore 2.0
- [ ] netCore 1.0
- [x] 4.7
- [ ] 4.6.x
- [ ] 4.5.x
Please describe the current behavior?
Log events are not being written to the configured sink/s if either the ElasticsearchJsonFormatter
OR ExceptionAsObjectJsonFormatter
are configured AND the Error level is specified AND an exception is specified with an inner exception AND formatStackTrackAsArray
is set to true
.
Please describe the expected behavior? Log events with an inner exception would be written to the configured sink/s
If the current behavior is a bug, please provide the steps to reproduce the issue and if possible a minimal demo of the problem
var logger = new LoggerConfiguration()
.WriteTo.Console(new ElasticsearchJsonFormatter(formatStackTraceAsArray: true))
.CreateLogger();
logger.Error(new Exception("outer", new Exception("inner")), "failure");
This is also reproducible on .NET Core 2.x
Merged to dev, so a package should be available soon.