Documentation Index
Fetch the complete documentation index at: https://mintlify.com/binary-person/rammerhead/llms.txt
Use this file to discover all available pages before exploring further.
RammerheadLogging is a lightweight leveled logger used by RammerheadProxy and all session store classes. It wraps any underlying log function and gates output by the active log level. You can swap in your own logger (winston, pino, etc.) by providing a logger function, control verbosity with logLevel, and customize the message prefix with generatePrefix.
Log levels
Levels are ordered from lowest to highest priority:| Level | Description |
|---|---|
'disabled' | All output suppressed. |
'debug' | Verbose internal state and store operations. |
'traffic' | Every proxied HTTP and WebSocket request URL. |
'info' | General lifecycle events. |
'warn' | Recoverable issues such as corrupt session files. |
'error' | Unrecoverable errors. |
logLevel to 'warn' emits warn and error messages but suppresses everything else.
Constructor
Initial log level. Must be one of
'disabled', 'debug', 'traffic', 'info', 'warn', or 'error'.The underlying log function. Must append a newline automatically (like
console.log does). Called once per emitted message with the full formatted string.The
this context bound when calling logger. Defaults to console so that console.log works correctly when passed as logger.Function called before each message to produce a prefix string. The default prefix looks like
[2024-01-15T12:00:00.000Z] [INFO] . Set to null to disable prefixes entirely.Properties
logLevel
Methods
log
data if level is at or above the current logLevel and logLevel is not 'disabled'.
One of the valid log level strings.
The message to emit. The prefix (if
generatePrefix is set) is prepended automatically.debug
logger.log('debug', data).
traffic
logger.log('traffic', data). Used internally to log every proxied request URL.
info
logger.log('info', data).
warn
logger.log('warn', data).
error
logger.log('error', data).
callLogger
logger function directly, bypassing level checks and prefix generation. Useful if you need to write a raw message regardless of the active log level.
Raw string passed to the underlying logger.