Class InstallationLogRouter
Selects which installed log service a caller gets, following the active log profile's routes and the fallback chain behind them.
Inherited Members
Namespace: Serenity.Installation.Logging
Assembly: Serenity.Installation.dll
Syntax
public class InstallationLogRouter
Remarks
This is a collaborator of the composition root rather than a part of it: routing is a decision about already-installed services, so it needs none of the installer's serialized state beyond what IInstalledLogServices exposes, and it is constructible — and therefore testable — without a scene.
Constructors
InstallationLogRouter(IInstalledLogServices)
Creates a router over the log services a composition root has installed.
Declaration
public InstallationLogRouter(IInstalledLogServices installedLogServices)
Parameters
| Type | Name | Description |
|---|---|---|
| IInstalledLogServices | installedLogServices | The installed services this router selects from. |
Methods
GetLogServiceFromKeyOrTypeName(string)
Resolves a LogInstaller based on a key or type name using various heuristics.
Declaration
public ILogService GetLogServiceFromKeyOrTypeName(string keyOrTypeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | keyOrTypeName | The key or type name to resolve the LogInstaller. |
Returns
| Type | Description |
|---|---|
| ILogService | The resolved LogInstaller or null if not found. |
GetLogServiceFromRoute(Type, UnityLogProfile)
Gets the appropriate LogInstaller based on the provided log profile and target installer type.
Declaration
public ILogService GetLogServiceFromRoute(Type targetInstallerType, UnityLogProfile logProfile = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | targetInstallerType | The target installer type for which to get the LogInstaller. |
| UnityLogProfile | logProfile | The log profile containing routing information. |
Returns
| Type | Description |
|---|---|
| ILogService | The resolved LogInstaller or a default if none found. |
RegisterLogServiceInServiceLocator(IServiceLocator)
Selects a single ILogService based on _installedLogServices.LogProfile.DefaultLoggerKey and registers it in the ServiceLocator. Must be called after both console and file log installers have completed, and before any aggregate that needs ILogService from ServiceLocatorBridge.
Declaration
public void RegisterLogServiceInServiceLocator(IServiceLocator serviceLocator)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceLocator | serviceLocator |