-
Notifications
You must be signed in to change notification settings - Fork 865
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
[Config] pinoWillSendConfig leads to configuration mutation #1963
Comments
As a workaround, downgrading to 8.20 (with {
"dependencies": {
"pino": "8.20",
},
"overrides": {
"fastify": {
"pino": "8.20"
}
}
}
|
Reproduced with simpler code: import pino, { LoggerOptions } from 'pino'
import config from 'config'
// this does not work:
const loggerConfig = config.get('api.logger') as LoggerOptions
// this works but is ugly:
const loggerConfigWorkaround = JSON.parse(JSON.stringify(config.get('api.logger'))) as LoggerOptions
export const logger = pino({
...loggerConfig,
})
|
Encountered same issue, thank you for the solution @nioc |
Thanks @mcollina for the fix ; now I'm waiting for testing it in 9.2.0 (or 9.1.1) release 😉 |
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. |
Hello,
I just upgrade from pino 8.19.0 to 8.21.0 and my code encounter this error:
Here is my code on src/api/index.ts:
And the config:
I try to add a attribute in both
logger
andlogger.transport.options
, nothing changes... So the logger received this config object:It seems it is #1930 which add this, can you help me?
The text was updated successfully, but these errors were encountered: