It will be cool to configure level per context, it's available in other languages and libraries
Closed this issue · 5 comments
So usually libraries have their own log management system, and their own configuration, it will be nice to have a standard at least in pino, so we can control the level for context. Context usually it's a class name, so pino can consume configuration like:
contextLevels:
MyClassName: info
AnotherClassName: off
that way we will be able to granularly disable annoying logs
https://stackoverflow.com/questions/4972954/how-to-disable-loggers-of-a-class-or-of-whole-package here is an example how it's done in java
we can't make it exactly like this, because there is no "packages" in js/ts, but even changing level by context will be super helpful in cases where we do use a library and want to listen less from it
This is already possible with child loggers. What's missing?
@mcollina can't find how to change the minimal level per child logger.
So the idea is to say that this child logger should show trace up to trace, for investigating the issue, even if root level is info.
can you please point me to the docs?
https://getpino.io/#/docs/child-loggers nothing like that here, or I'm blind
will give it a try, thanks
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.