def METHOD_NAME(self, record):
    data = {
        'action': record.formhub_action,
        'user': record.request_username,
        'account': record.account_username,
        'audit': {},
        'msg': record.msg,
        # save as python datetime object
        # to have mongo convert to ISO date and allow queries
        'created_on': datetime.utcfromtimestamp(record.created),
        'levelno': record.levelno,
        'levelname': record.levelname,
        'args': record.args,
        'funcName': record.funcName,
        'msecs': record.msecs,
        'relativeCreated': record.relativeCreated,
        'thread': record.thread,
        'name': record.name,
        'threadName': record.threadName,
        'exc_info': record.exc_info,
        'pathname': record.pathname,
        'exc_text': record.exc_text,
        'lineno': record.lineno,
        'process': record.process,
        'filename': record.filename,
        'module': record.module,
        'processName': record.processName
    }
    if hasattr(record, 'audit') and isinstance(record.audit, dict):
        data['audit'] = record.audit
    return data