Skip to content
Warlock.js v4

Channel configurations

Every built-in channel extends BasicLogConfigurations (the shared options — levels, dateFormat, filter, context, redact; see Types) and adds its own fields.

ConsoleLog options — BasicLogConfigurations plus:

OptionTypeDefaultDescription
showContextbooleanfalseRender the entry’s context on a second line via util.inspect. When false, context is dropped from console output (file/JSON channels still keep it).
contextDepthnumber4Depth passed to util.inspect when rendering context. Only applies when showContext is enabled.

FileLog options — BasicLogConfigurations plus:

OptionTypeDefaultDescription
storagePathstringprocess.cwd() + "/storage/logs"Directory where log files are stored. Created automatically.
namestring"app"Base file name, without extension.
chunk"single" | "daily" | "hourly""single"How entries split across files.
rotatebooleantrueRotate the file when it exceeds maxFileSize.
extensionstring"log"File extension. Ignored by JSONFileLog (always "json").
rotateFileNamestring"DD-MM-YYYY"Day.js format string used in the rotated file’s name ({name}-{rotateFileName}-{Date.now()}.{extension}).
maxFileSizenumber10485760 (10 MB)Max bytes before rotation. Only checked when rotate is true.
maxMessagesToWritenumber100Messages held in the in-memory buffer before flushing. Also flushed every 5 seconds.
groupBy("level" | "module" | "action")[]noneArrange files into a subdirectory hierarchy. Order = nesting depth.

FileLogConfig also re-declares levels and dateFormat from the shared base, so they’re available alongside the file-specific options.

JSONFileLog extends FileLog — it accepts the entire FileLogConfig shape and behaves identically for chunking, rotation, buffering, and groupBy. The one override: extension is forced to "json" regardless of what you pass.

See JSON File Channel for the output-format differences.