magiclogger - v0.1.0
    Preparing search index...

    Interface WebSocketTransportOptions

    WebSocket transport options.

    interface WebSocketTransportOptions {
        auth?: { headers?: Record<string, string>; token?: string };
        enabled?: boolean;
        encoding?: "json" | "msgpack" | "protobuf";
        excludeTags?: string[];
        filter?: (entry: LogEntry) => boolean;
        format?: "json" | "plain" | "custom";
        formatter?: (entry: LogEntry) => string | Buffer<ArrayBufferLike>;
        level?: string;
        levels?: string[];
        name?: string;
        protocol?: string | string[];
        reconnect?: { delay?: number; enabled?: boolean; maxAttempts?: number };
        silent?: boolean;
        tags?: string[];
        timeout?: number;
        url: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    auth?: { headers?: Record<string, string>; token?: string }

    Authentication token or credentials.

    enabled?: boolean

    Whether this transport is currently active. Allows runtime enabling/disabling of transports.

    true
    
    encoding?: "json" | "msgpack" | "protobuf"

    Message encoding.

    'json'
    
    excludeTags?: string[]

    Tags that exclude logs from this transport. Logs with any of these tags are skipped.

    filter?: (entry: LogEntry) => boolean

    Custom filter function for advanced filtering logic. Return true to process the log, false to skip.

    format?: "json" | "plain" | "custom"

    Output format for this transport.

    'json'
    
    formatter?: (entry: LogEntry) => string | Buffer<ArrayBufferLike>

    Custom formatter function. Used when format is 'custom'.

    level?: string

    Minimum log level this transport will handle. Logs below this level are ignored by this transport.

    'info'
    
    levels?: string[]

    Custom levels this transport should handle. Allows fine-grained control over what gets logged where.

    name?: string

    Unique name identifier for this transport instance. Used for managing multiple transports.

    protocol?: string | string[]

    WebSocket protocol to use.

    reconnect?: { delay?: number; enabled?: boolean; maxAttempts?: number }

    Reconnection options.

    silent?: boolean

    Whether to handle errors silently or propagate them.

    true
    
    tags?: string[]

    Tags that must be present for this transport to handle a log. If specified, only logs with at least one matching tag are processed.

    timeout?: number

    Timeout for transport operations in milliseconds.

    30000 (30 seconds)
    
    url: string

    WebSocket server URL.