Monday 7 August 2017

NodeJS hierarchical logging module?

I am trying to find a suitable replacement for log4js.Basically i am looking for something more similar to pythons logging framework. Basically where i can define a hierarchy of loggers.For example in python:logger = logging.getLogger('hats.cats')This creates a logger cats, that has a parent logger hats. I can configure hats, attach handlers, etc to it, and it will propagate downwards in the tree to cats.Log4js - Does not elegantly support this without me defining every logging category in advance.winston - Does not support child loggersRufus - Has not been updated in almost 4 yearsdebug - Is awesome, but its too basic for my needsBunyan - Does not easily support child loggersThe main reason i am looking for this is because our codebase is massive. I would like to be able to turn on and off diagnostic logging for parts of our app while the app is running. E.g. i would like to be able to suddenly disable all loggers under app.models, or if i really wanted to be specific i would turn on logging for app.models.Cat.

Submitted August 07, 2017 at 08:55AM by SonOfSpades

No comments:

Post a Comment