Added logging and some conditional logic

Change made to debug Jenkins behavior.