You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the documentation, it is noted that there's an option "logger" which can be passed
logger: pino-http can reuse a pino instance if passed with the logger property
However, it is not entirely correct: according to the code, pino instance isn't reused, but a child is created from this instance. This way, for example, it is not possible to change log level in the runtime. (since changing log level on the "root" instance doesn't change the child's log level). Also, there's no way (according to the documentation) to change middleware's logger level in the runtime (since it's not documented how logger is exposed).
My concern is, however, that this field isn't part of an API, since it is not documented. So, it can be "removed" or renamed in any version w/o notice.
Can we declare this .logger instance as a part of public API and document it (I can help with documentation, if needed).
The text was updated successfully, but these errors were encountered:
In the documentation, it is noted that there's an option "logger" which can be passed
However, it is not entirely correct: according to the code, pino instance isn't reused, but a child is created from this instance. This way, for example, it is not possible to change log level in the runtime. (since changing log level on the "root" instance doesn't change the child's log level). Also, there's no way (according to the documentation) to change middleware's logger level in the runtime (since it's not documented how logger is exposed).
Example:
This can be bypassed by using the
middleware.logger
field, like this:My concern is, however, that this field isn't part of an API, since it is not documented. So, it can be "removed" or renamed in any version w/o notice.
Can we declare this
.logger
instance as a part of public API and document it (I can help with documentation, if needed).The text was updated successfully, but these errors were encountered: