TypeError: object of type 'int' has no len(), LogisticRegression()
RandomizedSearchCV expects you provide dictionary of parameters-values to try, like in your code above:

rand_grid = {'log__C':[1,10,100,1000],
             'log__random_state':42} # values should be in []


Since the idea is to search values which give the best performance, you are expected to provide several values, as a list of values. Though in your case you only provided only one value, it won't raise error as long as it was written as list (inside []).

However it's a bit weird if you only have one value to search. So better you fix those values when you initialize the estimator (i.e LogisticRegression())., e.g: 

# you want to see which values perform best for params C and max_iter.
rand_grid = {'log__C':[1,10,100,1000]
             'log__max_iter': [100,200,300]}  

# you have fix value for params random_state, penalty and fit_intercept
logReg = LogisticRegression(random_state=42, penalty='l1', fit_intercept=False)

log_rand = RandomizedSearchCV(pipe_opt('log',logReg),
                              rand_grid,n_iter=100,cv=3,
                              random_state=42,n_jobs=-1)