Adding logging functionality.
Added logging functionality