<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.0" />

Serilog.EnvironmentLoggerConfigurationExtensions

Extends LoggerConfiguration to add enrichers for Environment. capabilities.
public static LoggerConfiguration WithEnvironmentName(this LoggerEnrichmentConfiguration enrichmentConfiguration)

Enrich log events with a EnvironmentName property containing the value of the ASPNETCORE_ENVIRONMENT or DOTNET_ENVIRONMENT environment variable.

public static LoggerConfiguration WithEnvironmentUserName(this LoggerEnrichmentConfiguration enrichmentConfiguration)

Enriches log events with an EnvironmentUserName property containing UserDomainName.

public static LoggerConfiguration WithEnvironmentVariable(this LoggerEnrichmentConfiguration enrichmentConfiguration, string environmentVariableName, string propertyName = null)

Enriches log events with an property containing the value of the specified Environment Variable using GetEnvironmentVariable.

public static LoggerConfiguration WithMachineName(this LoggerEnrichmentConfiguration enrichmentConfiguration)

Enrich log events with a MachineName property containing the current MachineName.