---
title: Operations and processes
summary: Catalog of operations performed by this library and their process flows.
status: draft
owner: SAIF Platform Team
last_reviewed: 2026-10-02
library: SAIF.NetCore.Logging
reference_type: package
---

# Operations and processes

This library performs 12 distinct operations across its three host-style loggers (web, Windows Service, console), spanning configuration/bootstrap, log-entry emission, exception formatting, outbound delivery to the SAIF Logging API, and disposal.

## Operation catalog

| ID | Operation | Primary component | Business rules |
| --- | --- | --- | --- |
| OP-01 | [Configure the web logger (`SaifLog`)](operations/op-01-configure-web-logger.md) | `SaifLog.Configure` | [BR-LOG-01](business-rules.md#br-log-01-application-threshold-overrides-organization-wide-default), [BR-LOG-02](business-rules.md#br-log-02-numeric-level-strings-bypass-enum-validation), [BR-LOG-04](business-rules.md#br-log-04-missing-override-level-throws-configuration-error), [BR-LOG-08](business-rules.md#br-log-08-log-entries-drop-until-logger-is-configured) |
| OP-02 | [Configure the Windows Service logger (`SaifWindowsServiceLog`)](operations/op-02-configure-windows-service-logger.md) | `SaifWindowsServiceLog.Configure` | [BR-LOG-01](business-rules.md#br-log-01-application-threshold-overrides-organization-wide-default), [BR-LOG-02](business-rules.md#br-log-02-numeric-level-strings-bypass-enum-validation), [BR-LOG-08](business-rules.md#br-log-08-log-entries-drop-until-logger-is-configured), [BR-LOG-09](business-rules.md#br-log-09-windows-service-logger-never-sets-error-route) |
| OP-03 | [Configure the console logger (`ConsoleLogService`)](operations/op-03-configure-console-logger.md) | `ConsoleLogService.Configure` | [BR-LOG-12](business-rules.md#br-log-12-console-logger-threshold-ignores-environment-api), [BR-LOG-18](business-rules.md#br-log-18-console-file-sinks-default-to-local-temp-path) |
| OP-04 | [Apply `appsettings.json` logger overrides](operations/op-04-apply-logger-overrides.md) | `SaifLogBase.ApplyLoggingSettingOverrides` | [BR-LOG-03](business-rules.md#br-log-03-logger-type-matching-is-case-sensitive), [BR-LOG-04](business-rules.md#br-log-04-missing-override-level-throws-configuration-error), [BR-LOG-05](business-rules.md#br-log-05-invalid-logger-type-throws-configuration-exception) |
| OP-05 | [Emit an information/warning log entry](operations/op-05-emit-information-log-entry.md) | `SaifLogBase` log methods | [BR-LOG-06](business-rules.md#br-log-06-ilogger-and-serilog-pipelines-run-sequentially), [BR-LOG-07](business-rules.md#br-log-07-log-id-generation-precedes-dispatch-after-exception-formatting), [BR-LOG-08](business-rules.md#br-log-08-log-entries-drop-until-logger-is-configured) |
| OP-06 | [Emit an exception/error log entry](operations/op-06-emit-exception-log-entry.md) | `SaifLogBase` log methods; `ExceptionFormatService` | [BR-LOG-06](business-rules.md#br-log-06-ilogger-and-serilog-pipelines-run-sequentially), [BR-LOG-08](business-rules.md#br-log-08-log-entries-drop-until-logger-is-configured), [BR-LOG-10](business-rules.md#br-log-10-exception-entries-formatted-or-defaulted-to-errorlogitem) |
| OP-07 | [Format a web-context exception](operations/op-07-format-web-context-exception.md) | `ExceptionFormatServiceForWeb` | [BR-LOG-10](business-rules.md#br-log-10-exception-entries-formatted-or-defaulted-to-errorlogitem), [BR-LOG-11](business-rules.md#br-log-11-only-web-logger-captures-unredacted-request-details) |
| OP-08 | [Post a log entry to the Logging API](operations/op-08-post-log-entry-to-logging-api.md) | `LoggingApiSink.Emit` | [BR-LOG-13](business-rules.md#br-log-13-sink-routes-exceptions-by-event-properties), [BR-LOG-14](business-rules.md#br-log-14-message-formatter-built-once-at-construction), [BR-LOG-15](business-rules.md#br-log-15-emit-is-async-void-with-no-exception-containment) |
| OP-09 | [Write a console log entry](operations/op-09-write-console-log-entry.md) | `ConsoleLogService`; `LogWriter` | [BR-LOG-12](business-rules.md#br-log-12-console-logger-threshold-ignores-environment-api), [BR-LOG-18](business-rules.md#br-log-18-console-file-sinks-default-to-local-temp-path) |
| OP-10 | [Correlate a log entry with the current activity](operations/op-10-correlate-log-entry-with-activity.md) | `SaifLogBase` log methods | [BR-LOG-07](business-rules.md#br-log-07-log-id-generation-precedes-dispatch-after-exception-formatting) |
| OP-11 | [Wire ASP.NET Core logging to the configured Serilog pipeline](operations/op-11-wire-aspnet-core-logging.md) | `WebHostBuilderExtensions.UseSaifLog` | [BR-LOG-16](business-rules.md#br-log-16-usesaiflog-delegates-entirely-to-useserilog), [BR-LOG-17](business-rules.md#br-log-17-usesaiflog-imposes-no-call-order-requirement) |
| OP-12 | [Dispose and flush a configured logger](operations/op-12-dispose-and-flush-logger.md) | `SaifLogBase.Dispose`; `ConsoleLogService.Dispose` | [BR-LOG-06](business-rules.md#br-log-06-ilogger-and-serilog-pipelines-run-sequentially), [BR-LOG-12](business-rules.md#br-log-12-console-logger-threshold-ignores-environment-api) |

## Process flow diagram
The following diagram visualizes the primary operational flow across these twelve operations, from configuration through log emission to disposal.

```mermaid
flowchart TD
    A[Host calls Configure] --> B{Read Environment API threshold}
    B -->|present or resolved| C[Apply appsettings.json overrides - OP-04]
    B -->|missing / invalid| B1["ArgumentException - Configure fails;<br>IsConfigured stays false on first attempt,<br>or keeps its prior value on a later failed attempt"]
    C --> D["Build Serilog pipeline + sinks"]
    D --> E["IsConfigured = true"]
    E --> F[Caller invokes a log method]
    F --> G{Entry type}
    G -->|info / warning| H[Emit information log entry - OP-05]
    G -->|exception| I[Format exception - OP-06 / OP-07]
    H --> J[Correlate with Activity - OP-10]
    I --> J
    J --> K{IsConfigured?}
    K -->|No| K1["Debug.Write diagnostic only; log ID still returned"]
    K -->|Yes| L["Write to ILogger, Serilog sinks"]
    L --> M{Sink}
    M -->|Logging API sink| N["IsException? - route to Send or SendException - OP-08"]
    M -->|Console / Event Log| O[Automatic sink write]
    F2["Host explicitly calls<br>WriteToAppLog / GetLog.Write*"] --> O2["Write console log file entry - OP-09<br>(separate explicit path, not a Serilog sink)"]
    N -->|unsuccessful RequestResult| P[Report to Console/Debug only]
    Q[Host disposes the logger] --> R[Dispose and flush - OP-12]
```

## Failure and edge-case behavior
- If neither the application-named nor the `tracingdefaults` base-threshold key resolves to a valid level, `Configure` throws `ArgumentException` and the logger does not become configured by this call — `IsConfigured` stays `false` if this is the first `Configure` attempt, or keeps its prior `true` value if a previously-successful `Configure` is being retried ([BR-LOG-08](business-rules.md#br-log-08-log-entries-drop-until-logger-is-configured)); every subsequent log call still returns a generated correlation ID (for exception-bearing calls, only once the pre-ID exception-formatting steps succeed) but writes only a Debug-level diagnostic trace instead of reaching `ILogger`/Serilog when `IsConfigured` is `false`.
- An invalid `SaifLogging:BaseLevel` value fails `ConsoleLogService`'s constructor, which fails DI resolution of `IConsoleLogService` for the whole host.
- A `SaifLogging:Loggers` override entry with an invalid or missing `Type` throws `SaifLogConfigurationException`; one with a missing `Level` throws `ArgumentException` (see [BR-LOG-04](business-rules.md#br-log-04-missing-override-level-throws-configuration-error)).
- `SaifWindowsServiceLog` never reads `logerrorroute`, so error entries from that host are posted with a `null` route.
- `LoggingApiSink.Emit` is `async void` with no try/catch anywhere in the class; an unsuccessful HTTP result is reported only to Console/Debug, but a thrown exception from the POST call itself is not caught anywhere in this sink — there is no universal failure-containment guarantee ([BR-LOG-15](business-rules.md#br-log-15-emit-is-async-void-with-no-exception-containment)).
- The console host's auxiliary file channels (`file0`–`file4`) are not automatic Serilog sinks fanned out from the main pipeline; they are only reached when the host explicitly calls `WriteToAppLog`/`GetLog(logType).Write*` ([OP-09](operations/op-09-write-console-log-entry.md)).

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Configuration](configuration.md)
- [Service registration](service-registration.md)
- [Business rules](business-rules.md)
- [API reference](api/index.md)

## Sources
- `src/SAIF.NetCore.Logging/SAIF.NetCore.Logging/SAIF.NetCore.Logging/SaifLogBase.cs`
- `src/SAIF.NetCore.Logging/SAIF.NetCore.Logging/SAIF.NetCore.Logging/SaifLog.cs`
- `src/SAIF.NetCore.Logging/SAIF.NetCore.Logging/SAIF.NetCore.Logging/SaifWindowsServiceLog.cs`
- `src/SAIF.NetCore.Logging/SAIF.NetCore.Logging/SAIF.NetCore.Logging/ConsoleLogService.cs`
- `src/SAIF.NetCore.Logging/SAIF.NetCore.Logging/SAIF.NetCore.Logging/Loggers/LoggingApiSink.cs`
- `src/SAIF.NetCore.Logging/SAIF.NetCore.Logging/SAIF.NetCore.Logging/ExceptionFormatter/ExceptionFormatService.cs`
- `src/SAIF.NetCore.Logging/SAIF.NetCore.Logging/SAIF.NetCore.Logging/Web/WebHostBuilderExtensions.cs`
