serilog-settings-configuration
serilog-settings-configuration copied to clipboard
Configure ResourceAttributes via appsettings.json
Hi,
Any suggestions on how to specifiy ResourceAttributes when configuring the sink via appsettings.json? Specifying Endpoint and Protocol in appsettings.json works fine, but I can't get the syntax for specifying the Dictionary<string, object> for ResourceAttributes:
This is my attempt in appsettings.json - the service.name attribute doesn't end up as "myapp-test", but some default value "unknown_service:...":
"WriteTo": [
{
"Name": "OpenTelemetry",
"Args": {
"endpoint": "http://MyOtelCollectorServer:4318/v1/logs",
"protocol": "HttpProtobuf",
"resourceAttributes": {
"service.name" : "myapp-test"
}
}
}
],
Is this even possible?
Steve