I’ve recently come across these two projects and, while each on its own is real goodness, when combined together they seem to be better than the sum of the parts.
MongoVision is a web front-end and visualization tool for MongoDB running on Prudence:
logmonger is a Python library that writes log entries to a MongoDb database, so that they can be more easily searchable and can also be aggregated, etc.
With only two lines of code you can redirect your logs to a permanent store backed by MongoDb:
logger = logging.getLogger() handler = logmonger.MongoHandler() logger.addHandler(handler) logger.setLevel(logging.INFO) logger.error("There was an error") logger.warning("This is a warning") logger.info("All is well") try: do_something_that_raises() except Exception as e: logger.exception(e)
I will experiment with both more and plan to post findings and other tips.
Leave a Reply