actually log error message when failed to connect to mongodb