Added option to allow errors to be logged to a separate log file