open(LOG, ">>$dir/$log_file") or croak "Unable to append to error log: $!";