Creates a new TransportManager instance.
Configuration options
Add a transport to the manager.
Transport configuration
The added transport
Check health of all transports.
Health status
Clear all global filters and transformers.
Close all transports and clean up. Ensures graceful shutdown with proper state transitions.
Resolves when closed
Disable a transport.
Transport name
Enable a transport.
Transport name
Flush all transports.
Resolves when all flushed
Get a transport by name.
Transport name
Transport instance or undefined
Get the current aggregation buffer size (for testing).
Buffer size
Get statistics for all transports.
Transport statistics
Get a transport by name.
Transport name
Transport instance
Get transport names.
Transport names
Check if a transport exists.
Transport name
Whether transport exists
Initialize the transport manager.
Resolves when initialized
List all transport names.
Array of transport names
Asynchronous log method for backward compatibility. Modern transports use worker threads internally for async operations.
Log entry
Resolves when logged
Log multiple entries efficiently.
Log entries
Resolves when all logged
High-performance synchronous log dispatch optimized for minimal overhead.
Performance optimizations:
Log entry to dispatch
Pause all logging.
Register a transport factory.
Transport type
Factory function
Register an already instantiated transport with the manager.
Transport instance to register
Resolves when transport is registered
Registers a transport synchronously (without init). Use for transports that don't require async initialization.
Transport to register
Remove a transport by name.
Transport name
Resolves when removed
Remove a transport from the manager.
Transport name
Resolves when removed
Reset statistics for all transports.
Resume logging and flush queue.
Resolves when queue is flushed
Enable or disable a transport.
Transport name
Whether to enable the transport
TransportManager handles all transport operations for the logger.
This version uses a registry pattern to avoid importing all transports, enabling proper tree-shaking. Transports must be registered before use.
TransportManager
Example