Adding log for every exception
Updating database connection management. Now open only one connection and close it when the application stop.