Added log on invalide database

* If the database isn't available, logging it and closing the server.