-
Notifications
You must be signed in to change notification settings - Fork 884
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
Print warning on changing log level when using multistream #2030
Comments
Yes exactly. Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests. |
@Tamir-M you wanted to get into open source, here is an easy issue I can help you if you want as I'm familiar with the codebase if you are not interested, you can comment here so other people from the community will know and can take it if they are interested |
Hi I'm sure @Livour would love to work on this as he's more familiar with the issue. |
After inspecting the issue I found out that it only occurs when passing a transport stream to the pino function. test('throws when custom level formatter is used with a multi-targets transport stream', async ({ throws }) => {
throws(() => {
pino({
level: 'info',
formatters: {
level (label) {
return label
}
}
},
transport({
targets: [
{
target: 'source1'
},
{
target: 'source2'
}
]
})
)
},
Error('transport.targets do not allow custom level formatters'))
}) I tried fixing it but I found it rather difficult because it only occurs when we pass a pre-made stream to the function (the transport function returns a |
I just spent 3h debugging why no logs output when used the elasticsearch transport with ECS format and stdout transport
And because ECS format change the log level, it did not logged as it's forbidden in multistream
So it would be great if we changed the log level and used multiple transports there will be warning reported
Log level shape should not change when using multiple transports if I understand correctly from here
The text was updated successfully, but these errors were encountered: