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

Update parent logger level does not cascade/propogate to children #2130

Open
ogallagher opened this issue Feb 14, 2025 · 0 comments
Open

Update parent logger level does not cascade/propogate to children #2130

ogallagher opened this issue Feb 14, 2025 · 0 comments

Comments

@ogallagher
Copy link

ogallagher commented Feb 14, 2025

If I create a parent logger

const logger = pino({name: 'parent', level: 'debug'})

and a child logger,

const child = logger.child({name: 'child'})

the child logger will inherit the log level from the parent. But if I later update the parent logger's level,

logger.level = 'error'

this does not change child.level. Is this intended behavior? Perhaps there could be an option to cascade level changes towards a logger's descendants?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant