def get_end_activities_from_log(trace_log, activity_key="concept:name"):
    """
    Get the end attributes of the log along with their count
    
    Parameters
    ----------
    trace_log
        Trace log
    activity_key
        Activity key (must be specified if different from concept:name)
    
    Returns
    ----------
    end_activities
        Dictionary of end attributes associated with their count
    """
    end_activities = {}
    
    for trace in trace_log:
        if len(trace) > 0:
            activity_last_event = trace[-1][activity_key]
            if not activity_last_event in end_activities:
                end_activities[activity_last_event] = 0
            end_activities[activity_last_event] = end_activities[activity_last_event] + 1
    
    return end_activities