Fixed some logging error handling code

Was getting some errors relating to a non-existing output directory that weren't getting reported properly.