Skip to content
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

XML configuration support #25

Closed
emrahcetiner opened this issue Nov 2, 2017 · 8 comments
Closed

XML configuration support #25

emrahcetiner opened this issue Nov 2, 2017 · 8 comments

Comments

@emrahcetiner
Copy link

Is there a plan for this feature?

@nblumhardt
Copy link
Member

Hi! There's no work-in-progress on this; the main issue is that we haven't come up with a syntax that we like - suggestions for how this would look are welcome. Thanks!

@emrahcetiner
Copy link
Author

this would look great for me:

<add key="serilog:using:Async" value="Serilog.Sinks.Async" />
<add key="serilog:write-to:Async:using:File" value="Serilog.Sinks.File" />
<add key="serilog:write-to:Async.bufferSize" value="1000" />

<add key="serilog:write-to:Async:File.path" value="..." />
<add key="serilog:write-to:Async:File.rollOnFileSizeLimit" value="true" />
<add key="serilog:write-to:Async:File.rollingInterval" value="Day" />
...

@nblumhardt
Copy link
Member

Thanks for the suggestion 👍

@pjduerden
Copy link

Any further update on if/when this would be available for use?

@nblumhardt
Copy link
Member

Here's a slight tweak:

<!-- No need to nest the `using` directive for `File` -->
<add key="serilog:using:Async" value="Serilog.Sinks.Async" />
<add key="serilog:using:File" value="Serilog.Sinks.File" />

<add key="serilog:write-to:Async.bufferSize" value="1000" />

<!-- Configure is an `Action<LoggerSinkConfiguration>`; this is what `write-to` effectively
        applies to, so by including the parameter name and dropping back into sink configuration
        is a mechanism we could carry through to other `Action<T>` arguments -->
<add key="serilog:write-to:Async.configure:File.path" value="..." />
<add key="serilog:write-to:Async.configure:File.rollOnFileSizeLimit" value="true" />
<add key="serilog:write-to:Async.configure:File.rollingInterval" value="Day" />
...

Trying to take a more regular approach to how parameters are matched/provided will make it easier to add reliable support to Serilog Analyzer.

The next step for this one is to create an issue in serilog/serilog, where the code for this feature would live. If there's support, and someone is able to send a strong PR, I don't think anything would prevent this going into a 2.6.1.

@nblumhardt
Copy link
Member

We're now tracking this in: serilog/serilog#1072

@mishrapw
Copy link

@nblumhardt
Hi,
Do we have XML configuration support in latest Async sink ?
Not able to figure out with above chain responses.

@nblumhardt
Copy link
Member

Hi @mishrapw - no, the issue linked in my comment one above yours is tracking progress. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants