SerilogHostBuilderExtensions.

WriteToAsyncConditionally(ISerilogConventionContext, Action<LoggerSinkConfiguration>) Method

Summary

Write to the log an async sink when running the default command (or web server / hosted process). Write to a sync sink when not running the default command.

Syntax

public static ISerilogConventionContext WriteToAsyncConditionally(this ISerilogConventionContext context, Action<LoggerSinkConfiguration> register)

Parameters

Name Type Description
context ISerilogConventionContext The context.
register Action<LoggerSinkConfiguration> The action to register the sink.

Return Value

Type Description
ISerilogConventionContext