https://github.com/serilog/serilog-sinks-observable
Write Serilog events to observers (Rx) through an IObservable
https://github.com/serilog/serilog-sinks-observable
rx serilog
Last synced: 3 months ago
JSON representation
Write Serilog events to observers (Rx) through an IObservable
- Host: GitHub
- URL: https://github.com/serilog/serilog-sinks-observable
- Owner: serilog
- License: apache-2.0
- Created: 2016-03-09T06:00:49.000Z (over 9 years ago)
- Default Branch: dev
- Last Pushed: 2024-06-28T22:42:25.000Z (about 1 year ago)
- Last Synced: 2025-03-26T19:04:01.357Z (4 months ago)
- Topics: rx, serilog
- Language: C#
- Homepage:
- Size: 66.4 KB
- Stars: 25
- Watchers: 14
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
# Serilog.Sinks.Observable [](https://ci.appveyor.com/project/serilog/serilog-sinks-observable) [](https://www.nuget.org/packages/Serilog.Sinks.Observable/)
Write Serilog events to observers (Rx) through an `IObservable`.
### Getting started
Install the package from NuGet:
```
Install-Package Serilog.Sinks.Observable
```Configure Serilog using `WriteTo.Observers`:
```csharp
Log.Logger = new LoggerConfiguration()
.WriteTo.Observers(events => events
.Do(evt => {
Console.WriteLine($"Observed event {evt}");
})
.Subscribe())
.CreateLogger();Log.Information("Hello, observers!");
Log.CloseAndFlush();
```More information about using Serilog is available in the [Serilog Documentation](https://github.com/serilog/serilog/wiki).
Copyright © 2016 Serilog Contributors - Provided under the [Apache License, Version 2.0](http://apache.org/licenses/LICENSE-2.0.html).