Adding logging to script