Added logging to the database class