I am trying to do sentiment analysis using Naive Bayes and have a doubt regarding log. While calculating posterior probability in Naive Bayes classifier, we apply log to prevent underflows and very small values. My question is that when applying log, $\log(p(x|Y=C)$, do we have to apply log separately to numerator and denominator like
$$ \frac{\log(\text{count of word in class }C)}{\log(\text{total words in class }C)} $$
or apply log to the result of division like
$$ \log\left(\frac{\text{count of word in class }C}{\text{total words in class }C}\right)? $$