Added logging handler and various logging statements