https://github.com/serilog-contrib/serilog-settings-xml
Xml file based configuration for Serilog (https://serilog.net)
https://github.com/serilog-contrib/serilog-settings-xml
serilog serilog-configuration xml-configuration
Last synced: 12 months ago
JSON representation
Xml file based configuration for Serilog (https://serilog.net)
- Host: GitHub
- URL: https://github.com/serilog-contrib/serilog-settings-xml
- Owner: serilog-contrib
- License: apache-2.0
- Created: 2017-11-24T00:30:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-12T12:05:47.000Z (over 5 years ago)
- Last Synced: 2025-05-14T11:09:00.139Z (about 1 year ago)
- Topics: serilog, serilog-configuration, xml-configuration
- Language: C#
- Size: 28.3 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
# Serilog.Settings.Xml [](https://ci.appveyor.com/project/rsabirov/serilog-settings-xml) [](https://www.nuget.org/packages/Serilog.Settings.Xml/)
An XML config reader for [Serilog](https://serilog.net).
### Motivation
XML based configuration can be more suitable for some projects, because:
- xml transformations can be used
- out of the box support in MS Deploy and Octopus Deploy
- configuration consistency in leagacy (not .NET Core) projects
### Getting started
The package needs to be installed from NuGet:
```powershell
Install-Package Serilog.Settings.Xml
```
To read configuration from xml configuration file use the `ReadFrom.Xml(filePath)` extension method on your `LoggerConfiguration`:
```csharp
Log.Logger = new LoggerConfiguration()
.ReadFrom.Xml("serilog.config")
... // Other configuration here
.CreateLogger()
```
You can mix and match XML and code-based configuration, but each sink must be configured **either** using XML **or** in code - sinks added in code can't be modified via config file.
### Configuration sample
```xml
```