Lime Web Components API Documentation - v6.24.0
    Preparing search index...

    Interface LogStoreBeta

    Extended handler interface for handlers that support log storage and retrieval

    Handlers like memory and IndexedDB implement this interface to allow querying and exporting stored logs.

    Implementations should respect the configured retention policies (maxEntries and maxAge) to prevent unbounded growth. These limits can be changed at runtime to dynamically adjust retention behavior.

    For high-volume logging, consider batching writes to reduce overhead.

    class MemoryHandler implements LogStore {
    maxEntries = 10000;
    maxAge = 7 * 24 * 60 * 60 * 1000; // 7 days

    handle(entry: LogEntry): void { }
    getLogs(): LogEntry[] { return []; }
    clear(): void { }
    }
    interface LogStore {
        maxAge?: number;
        maxEntries?: number;
        minLevel?: LogLevel;
        clear(): void | Promise<void>;
        getLogs(): LogEntry[] | Promise<LogEntry[]>;
        handle(entry: LogEntry): void | Promise<void>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    maxAge?: number

    Maximum age of log entries in milliseconds

    Entries older than this age should be removed during cleanup. If not specified, no age-based cleanup is performed.

    This can be changed at runtime to dynamically adjust retention.

    // Retain logs for 7 days
    store.maxAge = 7 * 24 * 60 * 60 * 1000;

    // Retain logs for 1 hour
    store.maxAge = 60 * 60 * 1000;
    maxEntries?: number

    Maximum number of log entries to retain

    When the number of stored entries exceeds this limit, the oldest entries should be removed. If not specified, no entry-count limit is enforced.

    This can be changed at runtime to dynamically adjust retention.

    minLevel?: LogLevel

    Minimum log level this handler should receive

    If specified, the factory will only pass log entries with a level equal to or higher than this value. If not specified, all log entries are passed to the handler.

    Level priority (lowest to highest): Debug → Info → Warn → Error

    This can be changed at runtime to dynamically adjust filtering.

    Methods

    • Beta

      Clears all stored log entries

      Returns void | Promise<void>

    • Beta

      Handles a log entry

      Implementations should handle their own errors internally to ensure reliability. However, any uncaught errors thrown by this method will be caught by the factory to prevent one handler from breaking others. Errors will be logged to the console but will not stop other handlers from receiving the log entry.

      Parameters

      Returns void | Promise<void>