public function log()
 {
     //don't check for Kwf_Exception::isDebug()
     //because we can't display the error anyway
     $user = "******";
     try {
         if (Zend_Registry::get('userModel')) {
             if ($u = Zend_Registry::get('userModel')->getAuthedUser()) {
                 $user = "******";
             }
         }
     } catch (Exception $e) {
         $user = "******";
     }
     $body = '';
     $body .= $this->_format('Exception', get_class($this));
     $body .= $this->_format('Thrown', $this->_url . ':' . $this->_lineNumber);
     $body .= $this->_format('Message', $this->getMessage());
     $body .= $this->_format('stack', print_r($this->_stack, true));
     $body .= $this->_format('REQUEST_URI', $this->_location);
     $body .= $this->_format('HTTP_REFERER', $this->_referrer ? $this->_referrer : '(none)');
     $body .= $this->_format('HTTP_USER_AGENT', isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '');
     $body .= $this->_format('User', $user);
     $body .= $this->_format('Time', date('H:i:s'));
     Kwf_Exception_Logger_Abstract::getInstance()->log($this, 'error', $body);
 }
 public function log()
 {
     if (Kwf_Exception::isDebug()) {
         return false;
     }
     $body = $this->_getLogBody();
     return Kwf_Exception_Logger_Abstract::getInstance()->log($this, 'error', $body);
 }
 public function log()
 {
     if (Kwf_Exception::isDebug()) {
         return false;
     }
     $body = '';
     $body .= $this->_format('REQUEST_URI', isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '(none)');
     $body .= $this->_format('HTTP_REFERER', isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '(none)');
     $body .= $this->_format('Time', date('H:i:s'));
     $body .= $this->_format('_GET', print_r($_GET, true));
     $body .= $this->_format('_POST', print_r($_POST, true));
     Kwf_Exception_Logger_Abstract::getInstance()->log($this, 'accessdenied', $body);
 }
 public function getDependency($dependencyName)
 {
     if ($dependencyName == 'KwfErrorHandler') {
         $deps = array();
         $deps[] = $this->_providerList->findDependency('KwfErrorHandlerCore');
         if (Kwf_Exception_Logger_Abstract::getInstance() instanceof Kwf_Exception_Logger_Raven) {
             $deps[] = new Kwf_Assets_Dependency_Dynamic_RavenJsDsn();
             $deps[] = $this->_providerList->findDependency('KwfErrorHandlerRaven');
         } else {
             $deps[] = $this->_providerList->findDependency('KwfErrorHandlerLog');
         }
         return new Kwf_Assets_Dependency_Dependencies($deps, $dependencyName);
     }
     return null;
 }
 public function log()
 {
     if (Kwf_Exception::isDebug()) {
         return false;
     }
     $requestUri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '(none)';
     $ignore = array('/favicon.ico', '/robots.txt');
     if (in_array($requestUri, $ignore)) {
         return false;
     }
     if (substr($requestUri, 0, 7) == '/files/' || substr($requestUri, 0, 12) == '/monitoring/') {
         //TODO: don't hardcode here
         return false;
     }
     $body = '';
     $body .= $this->_format('REQUEST_URI', isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '(none)');
     $body .= $this->_format('HTTP_REFERER', isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '(none)');
     $body .= $this->_format('Time', date('H:i:s'));
     Kwf_Exception_Logger_Abstract::getInstance()->log($this, 'notfound', $body);
 }