---
title: IConsoleLogService
summary: API reference for IConsoleLogService.
status: draft
owner: saif-docgen
last_reviewed: 2026-09-15
library: SAIF.Framework.Common
reference_type: package
---

# IConsoleLogService

Contract for a multi-log logging façade that registers named/typed log files and routes writes and exceptions to them. No implementation ships in this library. ([BR-091](../../business-rules.md#br-091-a-log-file-must-be-registered-against-a-log-id-before-it-can-be-written-to%2C-and-log-writers-are-retrieved-by-that-id), [BR-094](../../business-rules.md#br-094-log-services-and-log-writers-are-disposable-resources-and-must-be-released-by-the-consuming-application))*

## Purpose
- Contract for a multi-log logging façade that registers named/typed log files and routes writes and exceptions to them. No implementation ships in this library. ([BR-091](../../business-rules.md#br-091-a-log-file-must-be-registered-against-a-log-id-before-it-can-be-written-to%2C-and-log-writers-are-retrieved-by-that-id), [BR-094](../../business-rules.md#br-094-log-services-and-log-writers-are-disposable-resources-and-must-be-released-by-the-consuming-application))*

## Context
- Namespace: `SAIF.Common.Interfaces`
- Assembly/package: `SAIF.Framework.Common`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| GetLog(string logId) | `ILogWriter GetLog(string logId)` | Looks up a registered writer by its string id. ([BR-091](../../business-rules.md#br-091-a-log-file-must-be-registered-against-a-log-id-before-it-can-be-written-to%2C-and-log-writers-are-retrieved-by-that-id)) |
| GetLog(LogType logType) | `ILogWriter GetLog(LogType logType)` | Looks up a registered writer by its fixed `LogType` slot. ([BR-092](<../../business-rules.md#br-092-a-console-application-may-address-at-most-five-conventional-log-files-(file0-file4)-plus-a-custom-category>)) |
| Logs | `IEnumerable<ILogWriter> Logs { get; }` | Enumerates every writer currently registered with the service. |
| LogException(Exception exception) | `void LogException(Exception exception)` | Records an exception to the service's error output. |
| RegisterLogFile(string logId, string filePath) | `void RegisterLogFile(string logId, string filePath)` | Associates a string id with a target file path, creating the underlying writer. ([BR-091](../../business-rules.md#br-091-a-log-file-must-be-registered-against-a-log-id-before-it-can-be-written-to%2C-and-log-writers-are-retrieved-by-that-id)) |
| Flush() | `void Flush()` | Flushes all registered writers. |
| Flush(string logId) | `void Flush(string logId)` | Flushes the writer registered under `logId`. |
| Flush(LogType logType) | `void Flush(LogType logType)` | Flushes the writer registered under the given `LogType`. |
| Write(string message) | `void Write(string message)` | Writes to the service's default output destination. |
| WriteError(string message) | `void WriteError(string message)` | Writes to the service's error destination. |
| WriteToAppLog(string message, string logId, bool line = true) | `void WriteToAppLog(string message, string logId, bool line = true)` | Writes `message` to the writer identified by `logId`, appending a line break by default. ([BR-093](../../business-rules.md#br-093-writetoapplog-appends-a-line-break-by-default-when-addressed-by-string-log-id%2C-but-not-by-default-when-addressed-by-logtype)) |
| WriteToAppLog(string message, LogType logType, bool line = false) | `void WriteToAppLog(string message, LogType logType, bool line = false)` | Writes `message` to the writer identified by `logType`, not appending a line break by default. ([BR-093](../../business-rules.md#br-093-writetoapplog-appends-a-line-break-by-default-when-addressed-by-string-log-id%2C-but-not-by-default-when-addressed-by-logtype)) |


> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `Common/SAIF.Common/Interfaces/IConsoleLogService.cs`
