You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// All logs from reqLog include { requestId: 'abc123' }constreqLog=log.child({requestId: 'abc123'});reqLog.info('Processing');// includes requestId automatically
Log statistics: error rate, top namespaces, busiest hour
dlog search <file> --query text
Search log text
CLI Examples
# Live tail production logs
dlog view app.log --follow
# Review only errors from the last hour
dlog view app.log --level error --since "1 hour ago"# Filter to a specific service namespace
dlog view app.log --namespace myapp:payments
# Get an overview of log health
dlog stats app.log
# Search for timeout errors
dlog search app.log --query "timeout"
Install
npm install debug-log
npx debug-log view <file>
API Reference
createLogger(namespace, options?)
Option
Type
Default
Description
format
'pretty' | 'json' | 'minimal'
'pretty'
Output format
redact
string[]
[]
Keys to redact from log context
file
string | null
null
Path to write JSON log file
Logger methods
Method
Signature
Description
debug
(message, context?)
Debug level log
info
(message, context?)
Info level log
warn
(message, context?)
Warning level log
error
(message, context?)
Error level log
fatal
(message, context?)
Fatal level log
child
(name: string)
Create namespaced child
child
(context: object)
Create context-bound child
time
(label: string)
Start a named timer
timeEnd
(label: string)
Stop timer, log elapsed ms
mark
(label: string)
Log performance mark + memory
group
(label: string)
Start visual group
groupEnd
()
End visual group
Zero dependencies · Node 18+ · Made by NickCirv · MIT
About
Zero-dependency structured debug logging with namespaces, levels, redaction, and a CLI viewer.