Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.06 KB

README.md

File metadata and controls

31 lines (21 loc) · 1.06 KB

Serilog.Sinks.Observable Build status NuGet Version

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:

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.