Adding timeout for connecting to allow mongo to start up and adding logging of this kind of error.