Log Stream Container Model - Manages multiple log streams with real-time topic-based synchronization.

This container model manages multiple LogStreamModel instances and handles real-time log events from the KOS system. It provides centralized management of log streams, automatic stream discovery, and coordinated event handling for efficient log processing across multiple sources.

Topic-Based Reactivity

The container listens to these KOS topics for real-time log management:

  • /kos/logs/subscription/addBlock/* - Fired when new log blocks are created
  • /kos/logs/subscription/updateBlock/* - Fired when existing log blocks are updated
  • /kos/logs/subscription/removeBlock/* - Fired when log blocks are removed
  • /kos/logs/subscription/lines/* - Fired when new log lines are added to blocks
  • /kos/logs/streams/add/* - Fired when new log streams are discovered

Key Features

  • Multi-stream Management - Handle multiple log streams simultaneously
  • Automatic Stream Discovery - Automatically add new streams as they become available
  • Topic-based Synchronization - Real-time updates via KOS event system
  • Stream Selection - Track currently selected stream for UI purposes
  • Block Management - Coordinate block updates across all managed streams

Common Use Cases

  • Log Dashboard - Central management of multiple log sources
  • System Monitoring - Monitor logs from all system components
  • Debugging Interface - Switch between different log streams during troubleshooting
  • Log Aggregation - Collect and manage logs from distributed sources

Example: Basic Usage

const logContainer = LogStreamContainer.instance('main-logger')
.options({})
.build();

// Subscribe to and manage multiple streams
await logContainer.subscribeToLogStream('application-logs');
const appStream = logContainer.getModel('application-logs');
logContainer.updateSelectedStream(appStream);

Use Declared Type

See

interface LogStreamContainerModel {
    id: string;
    updateSelectedStream(stream?): void;
    selectedStream?: LogStreamModel;
}

Methods

  • -------------------LIFECYCLE----------------------------

    Parameters

    Returns void

Properties

id: string

Unique identifier for the container model instance

selectedStream?: LogStreamModel

Currently selected log stream for UI display purposes