Skip to content
Documentation

IHakomDatabaseLoggerOptions Interface

Configures the behavior of a HAKOM database logger.

public interface IHakomDatabaseLoggerOptions

These options control which repository the logger writes to, the minimum log level, and the parameters of the internal write queue. Options are typically populated from the Logging:HakomDatabase configuration section.

The database logger uses a background queue to write entries asynchronously, preventing logging calls from blocking the application. The QueueSize, TimeToWaitForOpenSlot, and FinalFlushGracePeriod properties control the queue behavior.

Default values:
Property
Microsoft.Extensions.Logging.LogLevel.Information
1024
~102 ms (0.1 * QueueSize)
~1536 ms (1.5 * QueueSize)

IHakomDatabaseLoggerOptions.FinalFlushGracePeriod Property

Section titled “IHakomDatabaseLoggerOptions.FinalFlushGracePeriod Property”

Gets the maximum time allowed for the logger to flush remaining queued entries on disposal.

System.TimeSpan FinalFlushGracePeriod { get; }

System.TimeSpan
A System.TimeSpan representing the grace period. After this period expires, the queue processor is cancelled and any remaining entries may be lost. Defaults to approximately 1536 ms.

IHakomDatabaseLoggerOptions.LogLevel Property

Section titled “IHakomDatabaseLoggerOptions.LogLevel Property”

Gets the minimum Microsoft.Extensions.Logging.LogLevel for which to write log entries.

Microsoft.Extensions.Logging.LogLevel LogLevel { get; }

Microsoft.Extensions.Logging.LogLevel
Messages with a level below this threshold are silently discarded. Defaults to Microsoft.Extensions.Logging.LogLevel.Information.

IHakomDatabaseLoggerOptions.QueueSize Property

Section titled “IHakomDatabaseLoggerOptions.QueueSize Property”

Gets the maximum number of log entries the internal write queue can hold.

int QueueSize { get; }

System.Int32
An System.Int32 representing the queue capacity. When the queue is full, new log messages will block up to TimeToWaitForOpenSlot before being discarded. Defaults to 1024.

IHakomDatabaseLoggerOptions.Repository Property

Section titled “IHakomDatabaseLoggerOptions.Repository Property”

Gets the name of the repository to log into.

string Repository { get; }

System.String
A System.String that must match a repository name configured in the Persistence:Repositories configuration section.

NoRepositoryConfiguredException
Thrown when no repository has been configured.

IHakomDatabaseLoggerOptions.TimeToWaitForOpenSlot Property

Section titled “IHakomDatabaseLoggerOptions.TimeToWaitForOpenSlot Property”

Gets the maximum time to wait for the queue to have room for an additional log entry.

System.TimeSpan TimeToWaitForOpenSlot { get; }

System.TimeSpan
A System.TimeSpan representing the wait timeout. If a slot does not become available within this period, the log entry is dropped. Defaults to approximately 102 ms.

© 2026 Volue.Version v0.6.38017 November 2026