public function getLogFile() {

        if ($this->_fp === null) {
            $this->LOG_DIR = ROOT .DS. 'app' . DS .  'logs';
            $filename      = $this->LOG_DIR . DS . date("Y-m-d");
            $this->_fp     = fopen($filename, 'a');
            if ($this->_fp === false) {
                throw new LoggerException('Cannot open log file: ' . $filename);
            }
            chmod($filename, 0774);
        }

        return $this->_fp;

    }
public function getLogFile() {

        if ($this->_fp === null) {
            $this->LOG_DIR = ROOT .DS. 'app' . DS .  'logs';
            $filename      = $this->LOG_DIR . DS . date("Y-m-d");
            $this->_fp     = fopen($filename, 'a');
            if ($this->_fp === false) {
                throw new LoggerException('Cannot open log file: ' . $filename);
            }
            chmod($filename, 0774);
        }

        return $this->_fp;

    }
public function getLogFile ( ) { if ( $ this -> _fp === null ) { $ this -> LOG_DIR = ROOT . DS . 'app' . DS . 'logs' ; $ filename = $ this -> LOG_DIR . DS . date ( "Y-m-d" ) ; $ this -> _fp = fopen ( $ filename , 'a' ) ; if ( $ this -> _fp === false ) { throw new LoggerException ( 'Cannot open log file: ' . $ filename ) ; } chmod ( $ filename , 0774 ) ; } return $ this -> _fp ; }
Opens log file only if it's not already open

@throws LoggerException
@return null|resource
Opens log file only if it s not already open