OptionaldirOptionalfileLog file name
OptionallevelLog level for this transport
OptionalsyncWrite 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"
OptionalmkdirCreate directory if it doesn't exist
Directory to write log files