Skip to main content

记录器

和任何网页应用程序一样, verdaccio 有可自定义的内置记录器。 您可以定义多种输出类型。

logs:
# console output
- {type: stdout, format: pretty, level: http}
# file output
- {type: file, path: verdaccio.log, level: info}
# Rotating log stream. Options are passed directly to bunyan. See: https://github.com/trentm/node-bunyan#stream-type-rotating-file
- {type: rotating-file, format: json, path: /path/to/log.jsonl, level: http, options: {period: 1d}}

Use SIGUSR2 to notify the application, the log-file was rotated and it needs to reopen it. Note: Rotating log stream is not supported in cluster mode. See here

# file output
logs: { type: file, path: verdaccio.log, level: info }

Verdaccio 5 does not support rotation file anymore, here more details.

Use SIGUSR2 to notify the application, the log-file was rotated and it needs to reopen it. Note: Rotating log stream is not supported in cluster mode. See here

Configuration

属性类型必须的范例支持版本描述
typestring[stdout, file]全部定义输出
pathstringverdaccio.log全部如果类型为文件,请定义该文件的位置
formatstring[pretty, pretty-timestamped]全部输出格式
levelstring[fatal, error, warn, http, info, debug, trace]全部详细级别