checks that key and logfile exist before attempting to write.