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

    Interface LoggerFactoryBeta

    Factory for creating Logger instances

    The factory is initialized with one or more log handlers. All loggers created from the factory will write to all configured handlers.

    // Get the logger factory from the platform
    const loggerFactory = platform.get('logger');

    // Create loggers for different components
    const httpLogger = loggerFactory.createLogger('http');
    const authLogger = loggerFactory.createLogger('auth');

    // Register a custom handler dynamically
    const customHandler = new MyCustomHandler();
    loggerFactory.addHandler(customHandler);

    // Retrieve all logs
    const allLogs = await loggerFactory.getLogs();

    // Clear all logs
    await loggerFactory.clearLogs();
    interface LoggerFactory {
        addHandler(handler: LogHandler): void;
        clearLogs(): Promise<void>;
        createLogger(scope: string): Logger;
        getLogs(): Promise<LogEntry[]>;
        removeHandler(handler: LogHandler): boolean;
    }
    Index

    Methods

    • Beta

      Registers a new handler with the factory

      The handler will receive all future log entries from all loggers (both existing and newly created). Historical logs are not replayed.

      Parameters

      Returns void

    • Beta

      Clears logs from all handlers that support storage

      This method clears logs from all handlers that implement LogStore. Handlers that don't support clearing (like console) are ignored.

      Returns Promise<void>

    • Beta

      Creates a logger instance for a specific scope/category

      Parameters

      • scope: string

        The scope or category for the logger (e.g., 'http', 'auth', 'component-name')

      Returns Logger

      A logger instance that writes to all configured handlers

    • Beta

      Retrieves logs from all handlers that support storage

      This method aggregates logs from all handlers that implement LogStore. Handlers that don't support log retrieval (like console) are ignored.

      Returns Promise<LogEntry[]>

      Array of all log entries from all storage handlers

    • Beta

      Removes a handler from the factory

      Parameters

      Returns boolean

      true if the handler was removed, false if it was not found