/** * Setup logging */ protected function setupLogging() { $path = $this->_config->getVarPath() . '/log'; //create an access log with browser information $accessLog = new \Monolog\Logger('access'); $accessLog->pushHandler(new \Monolog\Handler\StreamHandler($path . '/access_log')); $accessMessage = "[{$_SERVER['REQUEST_METHOD']} {$_SERVER['REQUEST_URI']} {$_SERVER['SERVER_PROTOCOL']}] " . '[' . (!empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '-') . '] ' . '[' . (!empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '-') . ']'; $accessLog->addInfo($accessMessage); //create an authenticationLog $this->_authLog = new \Monolog\Logger('authentication'); $this->_authLog->pushHandler(new \Monolog\Handler\StreamHandler($path . '/authentication_log')); //create an authenticationLog $this->_404Log = new \Monolog\Logger('404'); $this->_404Log->pushHandler(new \Monolog\Handler\StreamHandler($path . '/404_log')); $this->_log = new \Monolog\Logger('jazzee'); $this->_log->pushProcessor(new \Monolog\Processor\WebProcessor()); $this->_log->pushProcessor(new \Monolog\Processor\IntrospectionProcessor()); $this->_log->pushHandler(new \Monolog\Handler\StreamHandler($path . '/strict_log')); $this->_log->pushHandler(new \Monolog\Handler\StreamHandler($path . '/messages_log', \Monolog\Logger::INFO)); $this->_log->pushHandler(new \Monolog\Handler\StreamHandler($path . '/error_log', \Monolog\Logger::ERROR)); $this->_log->pushHandler(new \Monolog\Handler\SyslogHandler('jazzee', 'syslog', \Monolog\Logger::ERROR)); //Handle PHP errors with out logs set_error_handler(array($this, 'handleError')); //catch any excpetions set_exception_handler(array($this, 'handleException')); }
protected function getThisFileStore() { if (is_null($this->_fileStore)) { $this->_fileStore = new \Jazzee\FileStore($this->_entityManager, $this->_jazzeeConfiguration->getVarPath() . '/cache/'); } return $this->_fileStore; }
/** * Get the path to the log directory * @param string $fileName * @return string */ protected function getPath($fileName) { $path = $this->_config->getVarPath() . '/log/' . $fileName; if (!($realPath = \realpath($path)) or !\is_readable($realPath)) { return false; } return $realPath; }
/** * PDF File configuration varialbes * @param \Jazzee\Configuration $configuration * @return array */ public static function getConfigurationVariables(\Jazzee\Configuration $configuration) { return array('defaultApplicantFileUploadSize' => $configuration->getDefaultApplicantFileUploadSize(), 'maximumApplicantFileUploadSize' => $configuration->getMaximumApplicantFileUploadSize()); }