# Path: baleen/config.py
# class MongoConfiguration(confire.Configuration):
# class ServerConfiguration(confire.Configuration):
# class BaleenConfiguration(confire.Configuration):
#     CONF_PATHS = [
#         "/etc/baleen.yaml",                      # System configuration
#         os.path.expanduser("~/.baleen.yaml"),    # User specific config
#         os.path.abspath("conf/baleen.yaml"),     # Local configuration
#     ]


import getpass
import logging
import logging.config
from baleen.utils.timez import *
from baleen.config import settings
from datetime import datetime
from socket import gethostname
from pymongo import MongoClient
from pymongo.errors import PyMongoError
        logger    = data.pop('name')
        level     = {
            'number': data.pop('levelno'),
            'name': data.pop('levelname'),
        }
        info      = tuple(unicode(arg) for arg in data.pop('args'))

        for key in ('relativeCreated', 'msecs', 'msg'):
            del data[key]

        data.update({
            'logger': logger,
            # 'process': process,
            'message': message,
            'timestamp': timestamp,
            'level': level,
            # 'location': location,
            'error': error,
            'user': getpass.getuser(),
            'host': gethostname(),
            # 'info': info,
        })

        return data

class MongoHandler(logging.Handler):

    def __init__(self, level=logging.NOTSET, **kwargs):
        super(MongoHandler, self).__init__(level)
        self.host            = kwargs.get('host', settings.database.host)

# Path: baleen/config.py
# class MongoConfiguration(confire.Configuration):
# class ServerConfiguration(confire.Configuration):
# class BaleenConfiguration(confire.Configuration):
#     CONF_PATHS = [
#         "/etc/baleen.yaml",                      # System configuration
#         os.path.expanduser("~/.baleen.yaml"),    # User specific config
#         os.path.abspath("conf/baleen.yaml"),     # Local configuration
#     ]


# Path: baleen/utils/mongolog.py
import getpass
import logging
import logging.config
from baleen.utils.timez import *
from baleen.config import settings
from datetime import datetime
from socket import gethostname
from pymongo import MongoClient
from pymongo.errors import PyMongoError

        logger    = data.pop('name')
        level     = {
            'number': data.pop('levelno'),
            'name': data.pop('levelname'),
        }
        info      = tuple(unicode(arg) for arg in data.pop('args'))

        for key in ('relativeCreated', 'msecs', 'msg'):
            del data[key]

        data.update({
            'logger': logger,
            # 'process': process,
            'message': message,
            'timestamp': timestamp,
            'level': level,
            # 'location': location,
            'error': error,
            'user': getpass.getuser(),
            'host': gethostname(),
            # 'info': info,
        })

        return data

class MongoHandler(logging.Handler):

    def __init__(self, level=logging.NOTSET, **kwargs):
        super(MongoHandler, self).__init__(level)
        self.host            = kwargs.get('host', settings.database.host)

        self.port            = kwargs.get('port', settings.database.port)