IHakomDatabaseLoggerOptions Interface
Configures the behavior of a HAKOM database logger.
public interface IHakomDatabaseLoggerOptionsRemarks
Section titled “Remarks”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) |
Properties
Section titled “Properties”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; }Property Value
Section titled “Property Value”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; }Property Value
Section titled “Property Value”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; }Property Value
Section titled “Property Value”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; }Property Value
Section titled “Property Value”System.String
A System.String that must match a repository name configured in the
Persistence:Repositories configuration section.
Exceptions
Section titled “Exceptions”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; }Property Value
Section titled “Property Value”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.