OptionalcontextOptional default context applied to all logs. Can include environment metadata, user data, etc. Individual log calls may override this.
OptionalfallbackFallback to synchronous logging when async buffers are full. Only applies when mode is 'async' or 'balanced'.
OptionalfileFile path for log output (SyncLogger only). When provided, logs will be written to this file synchronously.
OptionalforceForce flush to disk after each write (SyncLogger only). Uses fsync to ensure data is written to disk.
OptionalidUnique identifier for the logger instance. Used for filtering logs across services or systems.
OptionalidCustom ID generator function for log entries.
OptionallevelMinimum log level to output. Messages below this level will be filtered out.
OptionallogDirectory to store log files in (Node only).
OptionallogNumber of days to retain log files before pruning (Node only).
OptionalmaxMaximum number of log entries to keep in browser storage. Has no effect in Node.js environments.
OptionalmodeLogger performance mode configuration.
OptionalperformancePerformance target hint for auto mode detection.
OptionalperformanceEnable performance mode to disable styling for maximum throughput. When enabled, all styling is bypassed for 3x+ performance improvement.
OptionalprettyPretty-printing mode for non-string variadic args. 'inspect' uses util.inspect in Node (with colors when enabled); 'json' uses JSON.stringify; default is 'inspect'.
OptionalprintWhen true, and verbose mode is enabled, append a compact [meta] summary of selected keys after the printed message. Meta remains structured for transports. Default: false
OptionalqueueQueue management configuration for handling backpressure. Can be a QueueManager instance or options to create one.
OptionalrateRate limiting configuration for log throttling. Can be a RateLimiter instance or options to create one.
OptionalredactorPII and sensitive data redaction configuration. Can be a Redactor instance or options to create one.
OptionalsamplerStatistical sampling configuration for volume control. Can be a Sampler instance or options to create one.
OptionalstorageName to use for browser storage (localStorage key or IndexedDB name). Has no effect in Node.js environments.
OptionalstoreWhether to store logs in browser storage when in browser environment. Has no effect in Node.js environments.
OptionalstrictEnforces strict log level behavior.
If true, unknown levels passed to .log() will throw.
If false, unknown levels are treated as custom and passed to .custom().
OptionaltagsOptional static tags applied to all logs from this logger. Helps group or filter logs by functional or organizational tag.
OptionalthemeTheme used to style logger output. Can be a string (theme name from ThemeManager) or a full object.
OptionalthemeOptional mapping of tags to theme names. When provided, if a logger has any tag present in this map and no explicit theme is set, the mapped theme will be auto-applied. This enables brand/company-specific themes via tags.
OptionaltransportsArray of transports to use for logging.
OptionaluseEnables or disables terminal or console color output.
OptionaluseWhether to use console transport by default. Set to false to disable automatic console output.
OptionaluseWhether to automatically create default transports.
OptionaluseWhether to use localStorage (true) or IndexedDB (false) for browser storage. Has no effect in Node.js environments.
OptionalverboseIf enabled, debug-level logs will be shown.
OptionalwriteWrites logs to disk in timestamped .log files (Node only).
Ignored in browsers.
Configuration options for a MagicLogger instance. These settings control the logger's behavior, output format, identity, and destination.