'Create a log object'

@db_base_plugin_common.convert_result_to_dict
def create_log(self, context, log):

    log_data = log['log']
    resource_type = log_data['resource_type']
    if (resource_type not in self.supported_logging_types):
        raise log_exc.InvalidLogResourceType(resource_type=resource_type)
    validators.validate_request(context, log_data)
    with db_api.context_manager.writer.using(context):
        log_data.pop('tenant_id', None)
        log_obj = log_object.Log(context=context, **log_data)
        log_obj.create()
    return log_obj
