src/Log/FilesystemLogger.php
public function openLog() {
        if ($this->file) {

            $logDir = dirname($this->file);
            if (!is_dir($logDir) || !file_exists($logDir)) {
                @mkdir($logDir, 0755, true);
            }

            if (!file_exists($this->file)) {
                $touched = touch($this->file);
                if (!$touched) {
                    throw new \Exception("Unable to open log file '{$this->file}', could not create");
                }
            }

            if (!is_writable($this->file)) {
                throw new \Exception("Unable to open log file '{$this->file}', not writable");
            }
            $this->fr = fopen($this->file, 'a');
        }
    }
public function openLog() {
        if ($this->file) {

            $logDir = dirname($this->file);
            if (!is_dir($logDir) || !file_exists($logDir)) {
                @mkdir($logDir, 0755, true);
            }

            if (!file_exists($this->file)) {
                $touched = touch($this->file);
                if (!$touched) {
                    throw new \Exception("Unable to open log file '{$this->file}', could not create");
                }
            }

            if (!is_writable($this->file)) {
                throw new \Exception("Unable to open log file '{$this->file}', not writable");
            }
            $this->fr = fopen($this->file, 'a');
        }
    }
public function openLog ( ) { if ( $ this -> file ) { $ logDir = dirname ( $ this -> file ) ; if ( ! is_dir ( $ logDir ) || ! file_exists ( $ logDir ) ) { @ mkdir ( $ logDir , 0755 , true ) ; } if ( ! file_exists ( $ this -> file ) ) { $ touched = touch ( $ this -> file ) ; if ( ! $ touched ) { throw new \ Exception ( "Unable to open log file '{$this->file}', could not create" ) ; } } if ( ! is_writable ( $ this -> file ) ) { throw new \ Exception ( "Unable to open log file '{$this->file}', not writable" ) ; } $ this -> fr = fopen ( $ this -> file , 'a' ) ; } }
Open log file for writing

Also closes currently open log file if needed.

@return void
Open log file for writing