pinojs / pino

🌲 super fast, all natural json logger
http://getpino.io
MIT License
14.21k stars 875 forks source link

Support customising levels for multiple transports #1538

Closed fenos closed 1 year ago

fenos commented 2 years ago

Hello, we all love pino!

However, i do not understand why i cannot have the level in my logs as a label when using multiple transports. It seems a weird limitation

ref https://github.com/pinojs/pino/blob/master/lib/tools.js#L284

Is there any workaround for now?

jsumners commented 2 years ago

Have you reviewed the issue that resulted in that code? https://github.com/pinojs/pino/issues/1353

fenos commented 2 years ago

Hello @jsumners

Yes, i've had a look at the issue you linked, however even by using the mixin function i'm still unable to customise the level property.

I can only add an alternative key ex: level-label

My main problem is that i started using pino with a single transport then added a second one later on, since i'd like to keep my schema consistent and still retain the level key to be the equivalent label is there a way to achieve this?

mcollina commented 2 years ago

Not at this time, I think it's possible to drop the limitation but it requires some work on pink. Would you like to send a PR?

VladimirMikulic commented 1 year ago

Hi @fenos - did you find some workaround?

github-actions[bot] commented 1 year ago

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.