cabinjs/cabin

Multiple destinations via axe, or multiple axe loggers?

jcfergus opened this issue · 1 comments

Really like Cabin, but I'm trying to figure out if it's possible to send logs to multiple destinations easily, either via multiple destinations in axe or multiple instances of axe with an individual destination for each. I can certainly do it with a custom logger, but was just curious if there was a way I could provide a list of loggers to the axe config or something similar. (Ideally with the ability to send some logs to one destination and some to another, etc.)

Thanks for your work on the library!

You just need to use a custom callback, and implement your own logic / loggers there, e.g. some logs on certain levels and only others on others. You can use setCallback in axe (nested dep), you can also use pino's custom hooks, or pass a custom callback function to axe config passed to Cabin instance. Endless ways to do this!