Added logging setup and added more logs to code