Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 422 Bytes

README.md

File metadata and controls

16 lines (11 loc) · 422 Bytes

EventSourceLogger

Forward in-process event source messages to a logger.

Example

var loggerFactory = LoggerFactory.Create(builder => {
    builder.AddConsole();
});
var consoleLogger = loggerFactory.CreateLogger<Program>(); // use your favourite logger here, e.g. event log

using var logger = new EventSourceLogger(consoleLogger);

logger.EnableEvents(EchoEventSource.Log, EventLevel.Informational);