Work with the logs of probability directly, rather than trying to compute the probability and then compute the log. You can do arithmetic with the logs, as well; multiplication becomes addition, of course. Addition is somewhat more complicated, but it's not too hard to work out how to do it without taking the exponential back.
In response to JM's question, it's easy to come up with practical problems where the probability of something happening is indeed so low that init underflows a float or double.