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

Child loggers print duplicated bindings #1378

Closed
avaly opened this issue Mar 22, 2022 · 2 comments · Fixed by #1380
Closed

Child loggers print duplicated bindings #1378

avaly opened this issue Mar 22, 2022 · 2 comments · Fixed by #1380

Comments

@avaly
Copy link

avaly commented Mar 22, 2022

I believe the change from #1367 has an undesired side effect to the output of the JSON fields in the log lines: the bindings are printed twice in child loggers.

Steps to reproduce

import pino from 'pino';

const log = pino();

log.info('Test info');
log.child({ category: 'CHILD' }).info('Test info');

Running this would print:

{"level":30,"time":1647938465297,"pid":43474,"hostname":"localhost","msg":"Test info"}
{"level":30,"time":1647938465297,"pid":43474,"hostname":"localhost","pid":43474,"hostname":"localhost","category":"CHILD","msg":"Test info"}

Notice the duplicated pid and hostname in the child log line.

@mcollina
Copy link
Member

Good spot, I'll revert asap.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants