0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-20 22:52:46 -05:00
verdaccio/website/docs/logger.md
Abraham Schilling ddb42431d1 build: configure prettier as formatter for json, yaml and markdown (#1930)
* build: configure pretter as formatter for most files

* chore: reformat code (#1931)

* chore: re-format all files

* chore: force run quality anaylsis test

Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>

Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>
2021-04-09 17:54:19 +02:00

30 lines
1.6 KiB
Markdown

---
id: logger
title: 'Logger'
---
As any web application, verdaccio has a customisable built-in logger. You can define multiple types of outputs.
<div id="codefund">''</div>
```yaml
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](https://github.com/trentm/node-bunyan#stream-type-rotating-file)
### Configuration
| Property | Type | Required | Example | Support | Description |
| -------- | ------ | -------- | ---------------------------------------------- | ------- | ------------------------------------------------- |
| type | string | No | [stdout, file] | all | define the output |
| path | string | No | verdaccio.log | all | if type is file, define the location of that file |
| format | string | No | [pretty, pretty-timestamped] | all | output format |
| level | string | No | [fatal, error, warn, http, info, debug, trace] | all | verbose level |