fixed a log_open bug when log is not opened.