A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/serilog/serilog-sinks-observable below:

serilog/serilog-sinks-observable: Write Serilog events to observers (Rx) through an IObservable

Write Serilog events to observers (Rx) through an IObservable.

Install the package from NuGet:

Install-Package Serilog.Sinks.Observable

Configure Serilog using WriteTo.Observers:

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.

Copyright © 2016 Serilog Contributors - Provided under the Apache License, Version 2.0.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4