Adds logging output for return status with error