protected function updateLogFile()
    {
        // update file. $dtStr is '_Y-m-d' or '_Y-m-d_H'
        if ($this->fileIsChanged()) {
            fclose($this->fileHandle);

            $logFile = $this->genLogFile(true);
            $this->file = $logFile;
            $this->fileHandle = @fopen($logFile, 'ab');

            if (!$this->fileHandle) {
                $this->stderr("Could not open the log file {$logFile}");
            }
        }
    }