src/Service/logService.php
public function logError($level = 7, $package, $message, $fileName = NULL, $backTrace = '')
    {
        //Adapt PHP Errors
        switch ($level) {
            case 8:          // E_NOTICE
            case 1024:       // E_USER_NOTICE
                $level = 4;
                break;

            case 2048:       //E_STRICT
            case 8192:       //E_DEPRICIATED
            case 16384:      //E_DEPRICIATED
                $level = 5;
                break;

            case 2:          //E_WARNING
            case 512:        //E_USER_WARNING
                $level = 3;
                break;

            case 256:
                $level = 2;
                break;

            default:
                $level = 2;
        }

        if ($this->_level == FALSE)
            return true;
        //Get the file path
        $this->_level = $level;
        $path = $this->_getPath($fileName);
        if (!is_writable($path))
            return false;
        $this->prepFile($path);

        //Create the log writer object
        $writer = new \Zend_Log_Writer_Stream($path);
        $writer->setFormatter($this->_formatter);

        //Instantiate logging object
        $logger = new \Zend_Log($writer);

        //Filter log entries to those allowed by configuration
        $filter = new \Zend_Log_Filter_Priority($this->_level);
        $logger->addFilter($filter);
        //Set additional information about the class and function that called the log
        // Add custom elements to default log package
        $logger->setEventItem('back_trace', $backTrace);
        $logger->setEventItem('package', $package);
        $logger->setEventItem('date', date("m/d/Y"));
        $logger->setEventItem('time', date("H:i:s"));
        //Write Log Entry
        $logger->log($message, $level);
        $this->closeFile($path);
        return TRUE;
    }
public function logError($level = 7, $package, $message, $fileName = NULL, $backTrace = '')
    {
        //Adapt PHP Errors
        switch ($level) {
            case 8:          // E_NOTICE
            case 1024:       // E_USER_NOTICE
                $level = 4;
                break;

            case 2048:       //E_STRICT
            case 8192:       //E_DEPRICIATED
            case 16384:      //E_DEPRICIATED
                $level = 5;
                break;

            case 2:          //E_WARNING
            case 512:        //E_USER_WARNING
                $level = 3;
                break;

            case 256:
                $level = 2;
                break;

            default:
                $level = 2;
        }

        if ($this->_level == FALSE)
            return true;
        //Get the file path
        $this->_level = $level;
        $path = $this->_getPath($fileName);
        if (!is_writable($path))
            return false;
        $this->prepFile($path);

        //Create the log writer object
        $writer = new \Zend_Log_Writer_Stream($path);
        $writer->setFormatter($this->_formatter);

        //Instantiate logging object
        $logger = new \Zend_Log($writer);

        //Filter log entries to those allowed by configuration
        $filter = new \Zend_Log_Filter_Priority($this->_level);
        $logger->addFilter($filter);
        //Set additional information about the class and function that called the log
        // Add custom elements to default log package
        $logger->setEventItem('back_trace', $backTrace);
        $logger->setEventItem('package', $package);
        $logger->setEventItem('date', date("m/d/Y"));
        $logger->setEventItem('time', date("H:i:s"));
        //Write Log Entry
        $logger->log($message, $level);
        $this->closeFile($path);
        return TRUE;
    }
The primary log function that will take an incoming message and specified paramter and log in the
appropriate location and format

@param int $level - Follow common BSD error levels
@param string $package - A way to group log messages
@param string $message - The actual message to log
@param string $fileName - An optional specific file name where the message should be logged
@param string $string - An optional list of the Application stack at the time of error
@return boolean -TRUE on success otherwise FALSE