protected function initFile()
    {
        if ($this->maxFileSize > 0 && file_exists($this->filename) && filesize($this->filename) >= $this->maxFileSize) {
            // need to reduce the file size
            $file = file($this->filename);
            $file = array_splice($file, ceil(count($file) * $this->reduceRatio));
            $this->filehandle = @fopen($this->filename, 'w');
            foreach ($file as $line) {
                @fwrite($this->filehandle, $line);
            }
        } else {
            $this->filehandle = @fopen($this->filename, 'a');
        }
    }