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

how to set RollingFile with App.config xml? #24

Closed
CADbloke opened this issue Oct 16, 2017 · 2 comments
Closed

how to set RollingFile with App.config xml? #24

CADbloke opened this issue Oct 16, 2017 · 2 comments

Comments

@CADbloke
Copy link

CADbloke commented Oct 16, 2017

Greetings

Thank you for your things. :)

In the same vein as #22, I can't guess how I am meant to wrap the rolling file config in app.config to use this async writer. Here is what I have for the raw rolling file ...

<appSettings>
    <add key="serilog:minimum-level" value="Verbose" />
    <add key="serilog:enrich:with-property:Application" value="tvCADdesktop" />
    <add key="serilog:enrich:with-property:Version" value="Beta 0.2017.07" />
    <add key="serilog:using:RollingFile" value="Serilog.Sinks.RollingFile" />
    <add key="serilog:write-to:RollingFile.pathFormat" value="%APPDATA%\CADbloke\tvCADdesktop\Logs\tvCADdesktop-{Date}.log" />
    <add key="serilog:write-to:RollingFile.retainedFileCountLimit" value="20" />
    <add key="serilog:write-to:RollingFile.retainedFileCountLimit" value="20" />
    <add key="ClientSettingsProvider.ServiceUri" value="" />
  </appSettings>

cheers
Ewen

@nblumhardt
Copy link
Member

Hi Ewen 👍 :-)

Unfortunately, the <appSettings> provider doesn't have a syntax to support the async wrapper, yet. There's a bit of work going on around this at the moment, so hopefully not the case for too long. As things stand, you need to revert back to using C# to configure the logger, and load any needed values from ConfigurationManager.AppSettings by hand.

Hope this helps,
Nick

@CADbloke
Copy link
Author

Thanks Nick. I'll move the config into code. It won't make much difference to me at this stage.

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

2 participants