def METHOD_NAME(self, conn, log_server):
    res = conn.execute("SELECT id FROM logs WHERE log_server = ?",
                       (log_server,))
    try:
        log_id = res.next()
    except StopIteration:
        raise database.KeyError("Unknown log server: %s", log_server)
    return log_id[0]