Table of Contents

Class SerilogWriter

Namespace
Arc4u.Diagnostics.Serilog
Assembly
Arc4u.Diagnostics.Serilog.dll

Base class of the Serilog based ILogWriter implementations. Initialize() creates a logger with the minimum level set to Verbose and the log context enricher, then lets the derived class complete the configuration in Configure(LoggerConfiguration).

public abstract class SerilogWriter : ILogWriter, IDisposable
Inheritance
SerilogWriter
Implements
Inherited Members

Properties

Logger

Gets the Serilog logger created by Initialize().

public Logger Logger { get; }

Property Value

Logger

Exceptions

InvalidOperationException

Initialize() has not been called.

Methods

Configure(LoggerConfiguration)

Configures the Serilog sinks, enrichers and filters of the logger.

public abstract void Configure(LoggerConfiguration configurator)

Parameters

configurator LoggerConfiguration

The logger configuration to complete.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Disposes the Serilog logger.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true when called from Dispose(); false when called from a finalizer, in which case nothing is released.

Initialize()

Initializes the writer and configures its underlying logging pipeline.

public void Initialize()