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

Any chance to use log level strings ("warn", "info") as for value of "level" with multiple targets #1854

Open
dbeck121 opened this issue Nov 24, 2023 · 4 comments

Comments

@dbeck121
Copy link

Hi,

I have the error

Error: option.transport.targets do not allow custom level formatters

when using a formatter to change loglevel numbers to labels and I already figured out that formatters does not work with multiple targets. Nevertheless our specification says we need labels instead of numbers in the log level so that all logs are harmonised.

I tried mixins but it feels they can not used to overwrite level field. Is there any other chance for us to have level = warn instead of the numeric counterpart?

Maybe some more information: We use pino/file and pino-loki as targets.

Thank you so much in advance!

@kibertoad
Copy link
Contributor

@mcollina I can pick this one up. Quick question - do you think this is just a plain bug, or there is something conceptually tricky about getting this to work? And maybe you can point me to the relevant part of the code where we are resolving levels for multiple transports?

@mcollina
Copy link
Member

mcollina commented Dec 6, 2023

There are no actual concern, the only issue is handling custom levels.

I don't have a specific pointer right now.

@kibertoad
Copy link
Contributor

Thanks, I'll write a reproduction test and will try to hunt down the relevant part of the code.

@dbeck121
Copy link
Author

That would be great! Thank you!

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

3 participants