Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: replace bunyan by pino.js #2148

Merged
merged 4 commits into from
Mar 30, 2021
Merged

feat!: replace bunyan by pino.js #2148

merged 4 commits into from
Mar 30, 2021

Conversation

juanpicado
Copy link
Member

@juanpicado juanpicado commented Mar 30, 2021

Reference #1760

Verdaccio replaces Bunyan by Pino.js as logger, with the objective to improve the performance and delegate some features to the external tools.

Breaking Changes

Logger configuration does not support multiple streams, thus the configuration must contain one single object.

Pretty loggin

Verdaccio logging pretty print is expensive in and not recommended to production environment, thus if the NODE_ENV=production is detected, will fall back to json format.

 http <-- 200, user: test(127.0.0.1), req: 'GET /is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz', bytes: 0/3250
 http <-- 200, user: test(127.0.0.1), req: 'GET /extend-shallow/-/extend-shallow-3.0.2.tgz', bytes: 0/3210
 http <-- 200, user: test(127.0.0.1), req: 'GET /define-property/-/define-property-2.0.2.tgz', bytes: 0/4047
 http <-- 200, user: test(127.0.0.1), req: 'GET /mute-stream/-/mute-stream-0.0.8.tgz', bytes: 0/2663
 http <-- 200, user: test(127.0.0.1), req: 'GET /ms/-/ms-2.1.2.tgz', bytes: 0/3017
 http <-- 200, user: test(127.0.0.1), req: 'GET /mkdirp/-/mkdirp-0.5.1.tgz', bytes: 0/4991

Multiple streams

Even if is supported by Pino.js is not recommended for performance reasons. The log property only recognize one single option. If you were using this feature and want it back, feel free to open a discussion or contribute as opt-in feature.

logs:  {type: stdout, format: pretty, level: http}

Rotating file is not longer supported

Pino.js does not support log rotation, thus if you were using this feature is recommended use an external tool.

 // this is not longer valid
 {type: rotating-file, format: json, path: /path/to/log.jsonl, level: http, options: {period: 1d}}

Deprecation

Old configuration won't crash the application, it will display a deprecation warning and will use the very first option in your configuration as fallback. Consider update your configuration due in the next major will throw an error.

➜  verdaccio
 warn --- config file  - /home/xxxx/.config/verdaccio/config.yaml
 deprecate: multiple logger configuration is deprecated, please check the migration guide.
 warn --- Plugin successfully loaded: verdaccio-htpasswd
 warn --- Plugin successfully loaded: verdaccio-audit
 warn --- http address - http://localhost:4873/ - verdaccio/5.0.0-alpha.0

@juanpicado juanpicado added this to the 5.x milestone Mar 30, 2021
@juanpicado juanpicado mentioned this pull request Mar 30, 2021
3 tasks
@juanpicado juanpicado marked this pull request as ready for review March 30, 2021 18:20
@juanpicado juanpicado changed the title feat: replace bunyan by pino.js feat!: replace bunyan by pino.js Mar 30, 2021
@juanpicado juanpicado linked an issue Mar 30, 2021 that may be closed by this pull request
3 tasks
@juanpicado juanpicado merged commit ee97dcb into master Mar 30, 2021
@delete-merged-branch delete-merged-branch bot deleted the feat-pinojs branch March 30, 2021 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verdaccio 5 release
2 participants