def testLogging(self):
        log = logging.getLogger('')
        log.setLevel(logging.DEBUG)

        log.addHandler(MongoHandler(self.collection))
        log.debug('test')

        r = self.collection.find_one({'levelname':'DEBUG', 'msg':'test'})
        self.assertEquals(r['msg'], 'test')
Simple logging example
dataset/ETHPy150Open andreisavu/mongodb-log/tests/test_handler.py/TestRootLoggerHandler.testLogging