Eigenverft.NetLib.Infrastructure
  • Guides
  • API
Show / Hide Table of Contents
  • Eigenverft.NetLib.Infrastructure.Hosting.Configuration.ConfigurationSets
    • ConfigurationSetApplyMode
    • ConfigurationSetBuilderBindingExtensions
    • ConfigurationSetCoordinatorExtensions
    • ConfigurationSetDefinition
    • ConfigurationSetEventArgs
    • ConfigurationSetEventKind
    • ConfigurationSetNotification
    • ConfigurationSetParticipantSwitchResult
    • ConfigurationSetPendingRestartChange
    • ConfigurationSetRegistration
    • ConfigurationSetStateApplyResult
    • ConfigurationSetStateApplyStatus
    • ConfigurationSetStateFailureKind
    • ConfigurationSetStateStatus
    • ConfigurationSetStateStoreEventArgs
    • ConfigurationSetStateStoreEventKind
    • ConfigurationSetStateStoreExtensions
    • ConfigurationSetStateStoreStatus
    • ConfigurationSetStatus
    • ConfigurationSetSwitchFailureKind
    • ConfigurationSetSwitchResult
    • ConfigurationSetSwitchStatus
    • ConfigurationSetSwitchableJsonExtensions
    • IConfigurationSetCoordinator
    • IConfigurationSetDesiredStateStore
    • IConfigurationSetEventHub
    • IConfigurationSetManager
    • IConfigurationSetStateStore
  • Eigenverft.NetLib.Infrastructure.Hosting.Configuration.Diagnostics
    • ConfigurationPrecedenceDiagnosticsExtensions
  • Eigenverft.NetLib.Infrastructure.Hosting.Configuration.Sources
    • HostApplicationBuilderConfigurationExtensions
  • Eigenverft.NetLib.Infrastructure.Hosting.Configuration.SwitchableJson
    • IJsonConfigurationSourcePreparation
    • ISwitchableJsonConfiguration
    • JsonConfigurationCandidatePreparation
    • JsonConfigurationCandidatePreparations
    • JsonConfigurationSourcePreparationContext
    • JsonConfigurationSourcePreparationException
    • JsonConfigurationValueProtection
    • SwitchableJsonConfigurationEventArgs
    • SwitchableJsonConfigurationEventKind
    • SwitchableJsonConfigurationExtensions
    • SwitchableJsonFailureKind
    • SwitchableJsonPreparationStatus
    • SwitchableJsonRegistrationOptions
    • SwitchableJsonRuntimeFailurePolicy
    • SwitchableJsonSwitchPreparation
    • SwitchableJsonSwitchResult
    • SwitchableJsonSwitchStatus
  • Eigenverft.NetLib.Infrastructure.Hosting.Configuration.Values
    • ConfigurationValueCodec
    • ConfigurationValueCodecs
    • ConfigurationValueKind
    • JsonConfigurationFileEncoder
  • Eigenverft.NetLib.Infrastructure.Hosting.DirectoryLayout
    • AppDirectoryLayout
    • AppDirectoryLayoutFactory
    • DefaultDirectory
    • DefaultDirectoryExtensions
    • DefaultDirectoryNameAttribute
    • HostApplicationBuilderDirectoryLayoutExtensions
    • HostApplicationBuilderFactory
    • IAppDirectoryLayout
  • Eigenverft.NetLib.Infrastructure.Hosting.Logging.BootstrapLogger
    • BootstrapLogger
    • BootstrapLogger<TCategoryName>
  • Eigenverft.NetLib.Infrastructure.Security.Certificates
    • CertificateKeyProfile
    • CertificatePurpose
    • CertificateRecoveryMode
    • CertificateSubject
    • ManagedCertificateAction
    • ManagedCertificateFile
    • ManagedCertificateFileOptions
    • ManagedCertificateResult
    • SelfSignedCertificateFactory
    • SelfSignedCertificateOptions
  • Eigenverft.NetLib.Infrastructure.Security.MachineBinding
    • PhysicalMachineBinding
  • Eigenverft.NetLib.Infrastructure.Text
    • Base92JsonSafeEncoder
  • Eigenverft.NetLib.Infrastructure.Transformations
    • ReversibleStringTransform
    • ReversibleStringTransform.TryReverseDelegate
    • ReversibleStringTransforms

Class BootstrapLogger

Provides non-generic convenience APIs for creating a pre-host logger using an explicit category name.

Inheritance
object
BootstrapLogger
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Eigenverft.NetLib.Infrastructure.Hosting.Logging.BootstrapLogger
Assembly: Eigenverft.NetLib.Infrastructure.dll
Syntax
public static class BootstrapLogger
Remarks

This is a convenience facade over the same cached factory used by BootstrapLogger<TCategoryName>.

Methods

| Edit this page View Source

CreateLogger(string, IConfiguration?)

Creates a pre-host ILogger for the given category name.

Declaration
public static ILogger CreateLogger(string categoryName, IConfiguration? configuration = null)
Parameters
Type Name Description
string categoryName

The logger category name.

IConfiguration configuration

Optional configuration used only when the process-wide factory is first created. It may apply the "Logging" section to the Microsoft fallback factory when the required logging configuration package is available.

Returns
Type Description
ILogger

A logger instance that can be used prior to building the host.

Examples
ILogger startupLogger = BootstrapLogger.CreateLogger("Startup", builder.Configuration);
Exceptions
Type Condition
ArgumentNullException

Thrown if categoryName is null.

| Edit this page View Source

CreateLoggerFactory(IConfiguration?)

Creates (or returns the cached) ILoggerFactory suitable for pre-host usage.

Declaration
public static ILoggerFactory CreateLoggerFactory(IConfiguration? configuration = null)
Parameters
Type Name Description
IConfiguration configuration

Optional configuration used to apply the "Logging" section (levels and filters) if available.

Returns
Type Description
ILoggerFactory

The process-owned cached ILoggerFactory. Callers may create loggers from it but must not dispose it.

| Edit this page View Source

CreateRequiredSerilogLogger(string, string, string?, string, bool)

Creates a required Serilog-backed pre-host logger for an explicit category from one JSON file.

Declaration
public static ILogger CreateRequiredSerilogLogger(string categoryName, string configurationFile = "AppSettings/BootstrapLoggerSettings.json", string? baseDirectory = null, string sectionName = "Serilog", bool reloadOnChange = false)
Parameters
Type Name Description
string categoryName

The logger category name.

string configurationFile

The isolated bootstrap Serilog JSON file.

string baseDirectory

The optional base directory; null uses BaseDirectory.

string sectionName

The Serilog configuration section name.

bool reloadOnChange

Whether existing Serilog level overrides and switches may follow JSON changes. Sink topology is not rebuilt.

Returns
Type Description
ILogger

A stable Serilog-backed ILogger.

Remarks

This is the non-generic facade for CreateRequiredSerilogLogger(string, string?, string, bool) and has the same strict first-call, no-fallback, isolated-configuration, reflection-only, and static-initialization semantics.

  • Edit this page
  • View Source
In this article
Back to top