The logarithmic function is applied to restrict the values of Inverse document frequency (Idf), which would range in billions without the logarithmic cap.
This would in turn reduce the impact of tf(term frequency) in the formula for the determination of weight of a term.
Weight of term = tf(w) X idf(w).
-Kuhu