Class LoggingSetupExtensions
Namespace: Momentum.ServiceDefaults.Logging
Assembly: Momentum.ServiceDefaults.dll
csharp
public static class LoggingSetupExtensions
Inheritance
object ← LoggingSetupExtensions
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Methods
AddLogging(IHostApplicationBuilder)
csharp
public static IHostApplicationBuilder AddLogging(this IHostApplicationBuilder builder)
Parameters
builder
IHostApplicationBuilder
Returns
ConfigureLogger(LoggerConfiguration, IConfiguration, IServiceProvider)
csharp
public static void ConfigureLogger(LoggerConfiguration loggerConfiguration, IConfiguration configuration, IServiceProvider services)
Parameters
loggerConfiguration
LoggerConfiguration
configuration
IConfiguration
services
IServiceProvider
UseInitializationLogger(WebApplicationBuilder)
Sets up a bootstrap logger for use during the two-stage initialization of the app host. This ensures that any exceptions or log events during host setup are captured and reported. See: https://github.com/serilog/serilog-aspnetcore?tab=readme-ov-file#two-stage-initialization
csharp
public static void UseInitializationLogger(this WebApplicationBuilder builder)
Parameters
builder
WebApplicationBuilder