def need_to_rotate_log(min_size, max_size, max_time_interval, log_size, time_interval):
    """Check if log match criteria for rotation"""
    return log_size >= max_size or (time_interval == max_time_interval and log_size >= min_size)