Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 8 days 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 8 years ago)
- Default Branch: dev
- Last Pushed: 2024-06-28T22:42:25.000Z (5 months ago)
- Last Synced: 2024-06-28T23:36:28.575Z (5 months ago)
- Topics: rx, serilog
- Language: C#
- Homepage:
- Size: 66.4 KB
- Stars: 19
- Watchers: 15
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
# Serilog.Sinks.Observable [![Build status](https://ci.appveyor.com/api/projects/status/adgctkfvda8or6rv?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-observable) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.Observable.svg?style=flat)](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).