-
Notifications
You must be signed in to change notification settings - Fork 2
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
Configuration sample issue #7
Comments
@simmotech thank you for reasing issue with sample config. I fixed that. For second part, I am not sure that I understand what you mean here. May be you can send me PR? |
Your code insists that the xml resides in its own file; I was suggesting that with a minor tweak, it could read the same xml from app.config:
This is the simple configuration section handler I used
So if a null filename is supplied, it tries to read it from here instead rather than throwing an exception. |
The configuration sample on the front page didn't work for me - no File sink got created.
Eventually, after a long time!, I worked out that needed to be added to the using section.
I know you guys would have realised that immediately but I am a newbie to serilog.
Also, the Xml extension method allows a null filePath but the XmlSettings ctor throws if it is null.
Can I suggest that a null filePath doesn't throw but instead Configure(), on seeing a null filePath, gets the xml from the config file instead: Its the identical Xml section and still goes to create identical KeyValuePairs, just from a different place.
(I know this works because I copied your code - since it is sealed and non-virtual - and tried it out)
The text was updated successfully, but these errors were encountered: