Generally, logistic regression assumes that logit of probability dependes linearly on predictors. So you need a transformation when dependence is not linear (and after transformation it is linear or close to linear). Most common one is logarithm, others that are used include powers, polynomials, splines.
So in practice you may investigate whether dependence is linear or not, I think that you can use Box-Tidwell test or just assess model fit with various options.
Logarithmic transform is also often suggested by interpretation of variables in the model (loosely speaking when you suspect that what matters is relative change in the variable, not absolute one).