serilog-sinks-elasticsearch
serilog-sinks-elasticsearch copied to clipboard
Support read formatStackTraceAsArray from configuration
Support read formatStackTraceAsArray from configuration
What issue does this PR address?
When I Add formatStackTraceAsArray
in my configuration file ,this paramater does not take effect.
Like this
"WriteTo": [
{
"Name": "Elasticsearch",
"Args": {
"nodeUris": "http://localhost:9200/",
"typeName": null,
"formatStackTraceAsArray": true
}
}
]
So I add paramater to LoggerConfiguration
method
Does this PR introduce a breaking change? No breaking I add paramater to the end
Please check if the PR fulfills these requirements
- [ ] The commit follows our guidelines
- [ ] Unit Tests for the changes have been added (for bug fixes / features)
Other information:
Thanks, although added to the back and being optional, does however still makes it breaking. It is not a binary-compatible change as the call site changes. I m a bit hesitant to accept as the method signature is already long, too long IMHO. Is there a way for you to work around it?
It looks like you have a problem with test script The test is pass but have error in test report stage
The Serilog only support inject paramater in method parameters,can't modify property after constructor.
so when you want to set all properties in a configuration file , must hav a method include all properties of ElasticsearchSinkOptions
. It can be an extension method or a constructor ,Add a constructor of ElasticsearchSinkOptions
is same as this PR.
I just want to set everything in the configuration file,If that's hard I can continue to set parameters through the program