Skip to content

NeedlrSerilogBootstrapperExtensions

NexusLabs.Needlr.Serilog

NeedlrSerilogBootstrapperExtensions Class

Extension methods for configuring NeedlrSerilogBootstrapper instances.

public static class NeedlrSerilogBootstrapperExtensions

Inheritance System.Object 🡒 NeedlrSerilogBootstrapperExtensions

Methods

NeedlrSerilogBootstrapperExtensions.Configure(this NeedlrSerilogBootstrapper, Action<LoggerConfiguration>) Method

Applies a custom Serilog.LoggerConfiguration to the bootstrapper. If not called, a default console sink is used.

public static NexusLabs.Needlr.Serilog.NeedlrSerilogBootstrapper Configure(this NexusLabs.Needlr.Serilog.NeedlrSerilogBootstrapper bootstrapper, System.Action<Serilog.LoggerConfiguration> configure);

Parameters

bootstrapper NeedlrSerilogBootstrapper

The bootstrapper to configure.

configure System.Action<Serilog.LoggerConfiguration>

A delegate that configures the Serilog.LoggerConfiguration.

Returns

NeedlrSerilogBootstrapper
A new NeedlrSerilogBootstrapper with the configuration applied.

Example

await new NeedlrSerilogBootstrapper()
    .Configure(cfg => cfg
        .MinimumLevel.Debug()
        .WriteTo.Console())
    .RunAsync(async (ctx, ct) => { /* ... */ });