pinojs/pino

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

Opened this issue · 4 comments

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!

@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?

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

I don't have a specific pointer right now.

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

That would be great! Thank you!