Class StructuredLogBackendFactory
Resolves the IStructuredStore backend selected by the shared, consumer-agnostic UnityStructuredBackendDefinition asset assigned to Backend, dispatching on the asset's concrete type. Store construction lives in the shared StructuredBackendStores helper, parameterized by this factory's StructuredBackendConsumerProfile; this class keeps only the log sink's own dispatch, fallback target, and table resolution.
Inherited Members
Namespace: Serenity.StructuredLogging.Installation.Installers
Assembly: Serenity.UnityStructuredLogging.Installation.dll
Syntax
public static class StructuredLogBackendFactory
Remarks
LocalFile and PlayerPrefs are always installed. Http additionally requires a base URL;
Postgres/MySql/Mongo/Sqlite additionally require their respective
SERENITY_STRUCTURED_POSTGRES/SERENITY_STRUCTURED_MYSQL/
SERENITY_STRUCTURED_MONGO/SERENITY_STRUCTURED_SQLITE scripting define and driver —
otherwise a warning is logged and the sink falls back to LocalFile. This factory never throws,
matching the framework's never-throw-in-runtime philosophy: every backend falls back to
LocalFile on missing configuration or construction failure, and LocalFile itself falls back
to the PlayerPrefs backend (which cannot fail to construct) if its own construction throws.
Methods
Create(UnityStructuredLogSettings, StoreTable, ILogService)
Resolves and constructs the structured log store selected by the settings' backend asset type.
Declaration
public static IStructuredStore Create(UnityStructuredLogSettings settings, StoreTable table, ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityStructuredLogSettings | settings | The structured log settings, or |
| StoreTable | table | The table or collection the store writes into, from ResolveTable(string). |
| ILogService | logService | Logging service used to report an unreachable backend or configuration fallback. Must be the console logger — never the structured sink itself, to avoid recursion. May be |
Returns
| Type | Description |
|---|---|
| IStructuredStore | The resolved IStructuredStore. |
ResolveTable(string)
Resolves the log table from the settings-configured name, or the default when blank.
Declaration
public static StoreTable ResolveTable(string tableOrCollectionName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | tableOrCollectionName | The configured table or collection name, or null/blank for the default. |
Returns
| Type | Description |
|---|---|
| StoreTable |