stop writing into log file if any error occurred (e.g. disk is full)