Skip to content

serilog/serilog-sinks-textwriter

Repository files navigation

Serilog.Sinks.TextWriter

The System.IO.TextWriter sink for Serilog.

Build status NuGet Version

Writes to a specified System.IO.TextWriter and can thus be attached to practically any text-based .NET output and the in-memory System.IO.StringWriter class.

var messages = new StringWriter();

var log = new LoggerConfiguration()
    .WriteTo.TextWriter(messages)
    .CreateLogger();

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