Configuration Object
All configuration options are passed through theconfig property:
Startup Options
showStartupMessage
Whether to display the startup message when the server starts.
- Type:
boolean - Default:
true
startupMessageFormat
Format of the startup message.
- Type:
'simple' | 'banner' - Default:
'banner'
Display Options
useColors
Enable colored output in console logs.
- Type:
boolean - Default:
true
stdout is not a TTY (Docker, CI, or output piped to a file), logs are printed uncolored even with useColors: true.
ip
Include client IP address in logs.
- Type:
boolean - Default:
false
x-forwarded-for— uses the first (leftmost) IP in the comma-separated list (the original client when behind proxies)x-real-ip— fallback whenx-forwarded-foris not present
{ip} placeholder will be empty. To test IP logging locally, you can pass a header manually, e.g. curl -H 'x-real-ip: 1.2.3.4' http://localhost:3000/.
autoRedact
Automatically redacts sensitive data from log messages, context objects, errors, and request headers before they are outputted. Redaction runs in two ways:
- By key/header name — a built-in, case-insensitive denylist (
authorization,cookie,x-api-key,password,secret,token,session, and more) wholly redacts the value of any matching object key or request header, regardless of what the value looks like.-,_, and camelCase variants (x-api-key,x_api_key,xApiKey) all match. - By value pattern — emails, IP addresses, Luhn-valid payment card numbers, and JWTs are redacted wherever they appear in strings, even in fields not covered by the key denylist.
redactKeys) for known sensitive fields instead of relying on their value happening to match a pattern.
- Type:
boolean - Default:
false
redactKeys
Additional key/header names to redact when autoRedact is enabled, extending the built-in denylist. Matching is case-insensitive and normalizes -, _, and camelCase variants.
- Type:
string[] - Default:
undefined
logErrorPayload
Log the offending payload (found/errors) from validation errors. Off by default — a failed schema validation embeds the entire request body (passwords, tokens, card fields) in the error message, so leaving this off keeps those values out of your logs and transports.
- Type:
boolean - Default:
false
logQueryParams
Include query parameters in the logged URL path.
- Type:
boolean - Default:
false
Timestamp Options
timestamp
Timestamp configuration.
- Type:
{ translateTime?: string } - Default:
undefined
Formatting Options
customLogFormat
Custom log message format using placeholders.
- Type:
string - Default:
undefined
customLogFormat is omitted, Logixlysia uses a built-in default that includes {now}, {service}, {icon}, {method}, {pathname}, {status}, {duration}, {message}, and {speed}.
Available placeholders:
{now}- Current timestamp{level}- Log level{duration}- Request duration (formatted, e.g.12ms,1.5s){method}- HTTP method{pathname}- Request path{status}- Response status code{statusText}- HTTP status text from Node’shttp.STATUS_CODES(e.g.Not Foundfor 404){message}- Custom message{icon}- Logixlysia fox (🦊); with colors enabled, a level-colored background chip around the emoji{speed}- When duration is at or aboveverySlowThreshold, appends⚡ slow(yellow when colors are on){service}- Service label from theserviceconfig option, shown as[name](dim when colors are on); empty if unset{ip}- Client IP (fromx-forwarded-fororx-real-ip; seeipoption){epoch}- Unix timestamp
service
Service name used by the {service} placeholder (evlog-style [my-app] prefix).
- Type:
string - Default:
undefined(no prefix)
slowThreshold
Duration threshold (ms) for green duration text when colors are enabled. Between this value and verySlowThreshold, duration is yellow.
- Type:
number - Default:
500
verySlowThreshold
Duration threshold (ms) at or above which duration is red (bold when colors are on) and the {speed} token adds ⚡ slow.
- Type:
number - Default:
1000
showContextTree
When true, structured context passed to logger helpers is printed as tree lines under the main log line instead of being crammed into {message} on the same line.
- Type:
boolean - Default:
true
contextDepth
How many levels of nested objects to expand in the context tree.
- Type:
number - Default:
1
Output Options
transports
Array of custom transport implementations.
- Type:
Transport[] - Default:
[]
useTransportsOnly
Use only transports, disable console and file logging.
- Type:
boolean - Default:
false
disableInternalLogger
Disable console logging.
- Type:
boolean - Default:
false
disableFileLogging
Disable file logging.
- Type:
boolean - Default:
false
onError
Called when a sink (transport, file, or rotation) or an enricher fails. Errors thrown by the hook itself are swallowed. When absent, failures go to stderr (rate-limited for transports and enrichers).
- Type:
(context: { sink: 'transport' | 'file' | 'rotation' | 'enricher'; error: unknown }) => void - Default:
undefined
enrichers
Context contributors run on every request. Whatever they return is merged into the request context, so the fields reach the console tree, file logs, and every transport at once. See Enrichers.
- Type:
EnricherLike[] - Default:
undefined
Sampling Options
sampling
Head + tail sampling. Head sampling keeps a percentage of records per level; tail sampling replays what head dropped once the finished request matches a rule. See Sampling for the full guide.
- Type:
{ head?: Partial<Record<LogLevel, number>>; tail?: { status?: number; durationMs?: number; paths?: string[] }; maxBufferedPerRequest?: number } - Default:
undefined(no sampling)
100 — tail alone rescues nothing, because only head-dropped records are buffered. Invalid values throw at plugin construction.
File Logging Options
logFilePath
Path to the log file.
- Type:
string - Default:
undefined
logRotation
Log rotation configuration.
- Type:
LogRotationConfig - Default:
undefined
logRotation.maxSize
Maximum file size before rotation.
- Type:
string | number - Format:
'1k','1m','1g'or bytes
logRotation.interval
Rotate when the live log file’s age reaches the given interval. Evaluated on write — an idle process does not rotate until it logs again. See Log Rotation for details.
- Type:
string - Format:
'1h','1d','1w'
logRotation.maxFiles
Maximum number of files or retention period.
- Type:
number | string - Format: Number or
'7d','30d'
logRotation.compress
Enable compression for rotated logs.
- Type:
boolean - Default:
false
logRotation.compression
Compression algorithm.
- Type:
'gzip' - Default:
'gzip'
Pino Options
pino
Pino logger configuration. Accepts all Pino options.
- Type:
PinoLoggerOptions & { prettyPrint?: boolean | object } - Default:
undefined
Common Pino Options
pino.level
Minimum log level.
- Type:
'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' - Default:
'info'
pino.prettyPrint
Enable pretty printing for development.
- Type:
boolean | object - Default:
false
Common prettyPrint Options
See pino-pretty documentation for complete reference.
pino.redact
Redact sensitive fields from logs.
- Type:
string[] | object - Default:
undefined
pino.base
Base fields added to all logs.
- Type:
object - Default:
undefined