-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs] Configuration for json #68
Comments
There's a generic parsing mechanism supplied by Serilog. While documenting it at the sink level would be nice for some users, it's definitely not a universally used feature so hard to imagine all sinks getting it; that's not to say a PR demonstrating a working config wouldn't work. I'd suggest asking this as a question on stackoverflow instead; you're far more likely to run into someone that understands the config file mechanisms and time to answer there; in general people monitor the |
I don't understand... are you saying that those features are not available when using json? |
Ok my findings so far for anyone else who is interested: {
"Name": "Async",
"Args": {
"bufferSize": 10, // <--- "Buffering & Dropping"
"blockWhenFull": true, // <--- "Blocking"
"configure": [
{
"Name": "File",
"Args": {
"path": "./logs/app.log",
"formatter": "Serilog.Formatting.Compact.CompactJsonFormatter, Serilog.Formatting.Compact"
}
}
]
}
} I still haven't figured out "Health Monitoring via the Monitor and Inspector interfaces". If anyone knows, please let me know. |
I am saying that despite having written some extensions for this sink, I've never used the json config mechanism and it's not on my list. In other words, understanding how to use the json config mechanism is orthogonal to this sink's behavior. The other thing is that there are going to be far more people looking at https://stackoverflow.com/questions/tagged/serilog than watching this sink; thats why in general it's best to discuss those things there - you'll get answers quicker. In particular the syntax and/or whether it's possible to configure those interfaces via JSON is something I'd be guessing at, whereas there are tens of thousands of people who have attempted configuring such aspects using the serilog config mechanism, and they're likely to be able to tell you whether this one can be made to work. (If you're patient, someone will eventually respond; just saying the best way to cover these things for all concerned is to use SO as the primary mechanism.) |
I fully agree about SO, but the docs could be made clearer as it's the first place many devs go to for info. BTW, most serilog sinks document how to use the code and json options, so I assumed the same for this one. And since there isn't such documentation I panicked - I didn't realise the json config was similar for all sinks. Thanks for explaining that. The stuff I documented above by trial and error seems to work (except for monitorign), so hopefully it can help others that end up here. Thanks for maintaining this plugin, it's really great! |
I am not for one moment debating that it would be great to get more complete examples into the repo:-
In other words, a PR would be really appreciated... You, as someone sitting there with a working config file, who didn't know how to do that until recently, are literally the best placed person on this planet to do that!
I personally happen to have contributed code to this sink, but am by no means a/the maintainer. There is an original author, and that author has a day job. It's an open source project, and it's on us to do what we can to make it the best it can be by our collective effort. |
I've never successfully made PRs on github - always seem to mess up. 😋 (I'm an xkcd sort of git user...) |
While you may be suffering from imposter syndrome, I have full confidence you'd make a much better PR than I would on this - the rest is up to you. (I am also an xkcd git user, I have a very small set of tactics I use, but I always work it out somehow...). Looking forward to seeing the PR ;) |
The monitor implementation can be configured using a Serilog hook in appsettings.json. I have uploaded an implementation that loads the monitor via appsettings.json |
Based on code from above, that from @raheinz57 and from other issues, I posted a full example here. |
The docs are not clear about the json option.
If specifying async in
appsettings.json
, how do we also specify:A very simple example would be helpful.
Thanks.
The text was updated successfully, but these errors were encountered: