@jenova-marie/wonder-logger - v2.0.15
    Preparing search index...

    Interface FileTransportOptions

    interface FileTransportOptions {
        dir?: string;
        fileName?: string;
        level?: Level;
        sync?: boolean;
        mkdir?: boolean;
    }
    Index

    Properties

    dir?: string

    Directory to write log files

    './logs'
    
    fileName?: string

    Log file name

    'app.log'
    
    level?: Level

    Log level for this transport

    'info'
    
    sync?: boolean

    Write synchronously (slower but ensures writes complete)

    ⚠️ IMPORTANT: Set to true for CLI applications and AWS Lambda functions to prevent sonic-boom initialization race conditions when process exits quickly (<200ms).

    Use Cases:

    • true: CLI tools, Lambda functions, Kubernetes jobs (quick exits)
    • false: Web servers, batch jobs, desktop apps (long-running, controlled shutdown)

    Performance Impact: ~4-5ms penalty for CLI apps with 10-50 log lines (negligible)

    Race Condition: Async file transports (sync: false) initialize asynchronously and may not be ready when quick-exit processes terminate, causing crashes: "Error: sonic boom is not ready yet"

    mkdir?: boolean

    Create directory if it doesn't exist

    true