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

Documents serilog/serilog-settings-appsettings#7 #89

Merged
merged 2 commits into from
Sep 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@ Log.Logger = new LoggerConfiguration()
.CreateLogger();
```

The equivalent configuration in XML (Serilog 2.6+) is:

```xml
<configuration>
<appSettings>
<!-- declare the switch -->
<add key="serilog:level-switch:$controlSwitch" value="Information" />
<!-- use it to control the root logger -->
<add key="serilog:minimum-level:controlled-by" value="$controlSwitch" />
<add key="serilog:using:Seq" value="Serilog.Sinks.Seq" />
<add key="serilog:write-to:Seq.serverUrl" value="http://localhost:5341" />
<add key="serilog:write-to:Seq.apiKey" value="yeEZyL3SMcxEKUijBjN" />
<!-- give the sink access to the switch -->
<add key="serilog:write-to:Seq.controlLevelSwitch" value="$controlSwitch" />
```

For further information see the [Seq documentation](http://docs.getseq.net/docs/using-serilog#dynamic-level-control).

### Compact event format
Expand Down