Closed irkush closed 4 years ago
It turned out that the formatter was not configured like the other sinks I use.
What behavior are you used to experiencing ?
I agree the documentation on this way of configuring is not good enough. I'll look into that.
I don't have time to work on this - so if someone has time to improve the documentation, please create a PR.
Hi!
Sorry for the late reply. I didn't see the question. Here is an example from how the File-sink is configured.
"Name": "File",
"Args": {
"path": "C:\\application\\log-.log",
"formatter": "NameSpace.MyFormatter, NameSpace.Common",
"retainedFileCountLimit": "7",
"rollingInterval": "Day"
}
},
If possible, it would be nice to change so that the variables are named in the same way as other sinks so that it is easier to add new sinks.
As an example, change the variable textFormatter to be named formatter in the Sink.
@irkush I'm not going to change the name of the property to align with other sinks, because that will be an unnecessary breaking change, that doesn't really address any real problem. I agree it's not perfect that the naming differs from other sinks - but in terms of configuration convention it's very clear how it works.
I'll work on improving the documentation as we have already talked about.
Enhancement to documentation should cover sink-configuration based on .config files.
Hi!
I have been trying to get the RabbitMQ sink to work for a couple of hours with the configuration done via appsettings.json.
The sink worked perfectly except the fact that I could not change how the logmessage was formatted.
I found the closed issue #89 which pushed me in the right direction. However I needed to pull the code and manually debug why my custom formatter wasn't used as the nuget-package just wouldn't work.
It turned out that the formatter was not configured like the other sinks I use.
So in order to save someone else a few hours I thought that the syntax for how to configure the sink via appsettings.json should be in the readme.md.
Here is how I got it to work: