Skip to main content

Logger

Deprecated: logs

The property is log. The older logs spelling is still accepted but emits a deprecation warning (VERWAR002) on startup and may be removed at any time.

As with any web application, Verdaccio has a customizable built-in logger. You can define multiple types of outputs.

# console output
log: { type: stdout, format: pretty, level: http }

or file output.

# file output
log: { type: file, path: verdaccio.log, level: info }
No built-in log rotation

Verdaccio does not rotate log files itself β€” it dropped that when the logger became pino, and neither 6.x nor 7.x brings it back. Use logrotate, or your platform's equivalent, and send SIGUSR2 afterwards so Verdaccio reopens the file it was writing to.

The default format depends on NODE_ENV​

When format is not set, it is json if NODE_ENV=production and pretty otherwise. This catches people out on first deploy: the same configuration that prints colourised lines on a laptop prints one JSON object per line in production. Set format explicitly if you want the same output in both places.

Sensitive data can be masked or removed using log redaction.

log:
type: stdout
format: pretty
level: http
redact:
paths:
[
'req.header.authorization',
'req.header.cookie',
'req.remoteAddress',
'req.remotePort',
'ip',
'remoteIP',
'user',
'msg',
]
censor: '<redacted>'

Configuration​

PropertyTypeRequiredExampleSupportDescription
typestringNo[stdout, file]alldefine the output
pathstringNoverdaccio.logallif type is file, define the location of that file
formatstringNo[pretty, pretty-timestamped]alloutput format
levelstringNo[fatal, error, warn, info, http, debug, trace]allverbose level
colorsbooleanNofalsealldisable or enable colors
redactobjectNosee aboveredact sensitive data
syncbooleanNotrueturn on synchronous logging