def add_extra_fields(d, record):
    """
    Put extra key/values found in record.__dict__ into d.

    :param d: dict for values
    :param record: The log record.
    """
    skip_list = ('args', 'asctime', 'created', 'exc_info', 'exc_text',
        'filename', 'funcName', 'id', 'levelname', 'levelno', 'lineno',
        'module', 'msecs', 'message', 'msg', 'name', 'pathname', 'process',
        'processName', 'relativeCreated', 'thread', 'threadName')
    for key, value in record.__dict__.items():
        if value is None:
            continue
        if key not in skip_list and not key.startswith('_'):
            d[key] = value
    return d
