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

# ILogWriter

Contract for a single log destination (one file), covering timestamp formatting and buffered writes. 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 single log destination (one file), covering timestamp formatting and buffered writes. 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 |
| --- | --- | --- |
| LogId | `string LogId { get; }` | The identifier this writer was registered under. |
| FilePath | `string FilePath { get; }` | The file path this writer targets. |
| LogType | `LogType LogType { get; }` | The fixed log slot this writer corresponds to, if any. |
| SetTimeFormat(string format) | `void SetTimeFormat(string format)` | Configures the timestamp format used by `WriteTimedLine`. |
| SetTimeDelimiter(string delimiter) | `void SetTimeDelimiter(string delimiter)` | Configures the delimiter placed between a rendered timestamp and the message. |
| SetWriteLinePrefix(string prefix) | `void SetWriteLinePrefix(string prefix)` | Configures a fixed prefix prepended to each written line. |
| Flush() | `void Flush()` | Flushes any buffered output for this writer to its underlying stream. |
| Write(string message) | `void Write(string message)` | Writes a message with no trailing line break. |
| WriteLine(string message) | `void WriteLine(string message)` | Writes a message followed by a line break. |
| WriteTimedLine(string message) | `void WriteTimedLine(string message)` | Writes a message prefixed with a formatted timestamp, followed by a line break. |
| GetUnderlyingStream() | `Stream GetUnderlyingStream()` | Exposes the raw stream backing this writer for advanced scenarios. |


> **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/ILogWriter.cs`
