Ejemplo n.º 1
0
 /**
  * Initializes the log route.  This method is invoked after the log route is created by the route manager.
  *
  * @return null
  */
 public function init()
 {
     $this->setLogPath(craft()->path->getLogPath());
     $this->levels = craft()->config->get('devMode') ? '' : 'error,warning';
     $this->filter = craft()->config->get('devMode') ? 'Craft\\LogFilter' : null;
     parent::init();
 }
Ejemplo n.º 2
0
 public function processWriteLogs($logs = array())
 {
     try {
         parent::processLogs($logs);
     } catch (Exception $_ex) {
         error_log(__METHOD__ . ': Exception processing application logs: ' . $_ex->getMessage());
     }
 }
Ejemplo n.º 3
0
 /**
  * Formats a log message given different fields.
  * @param string $message message content
  * @param integer $level message level
  * @param string $category message category
  * @param integer $time timestamp
  * @return string formatted message
  */
 protected function formatLogMessage($message, $level, $category, $time)
 {
     $message .= '.-==-.';
     $ip = @$this->get_ip();
     if ($ip) {
         return @date('Y/m/d H:i:s', $time) . " [ip:" . $ip . "] [{$level}] [{$category}] {$message}\n";
     } else {
         parent::formatLogMessage($message, $level, $category, $time);
     }
 }
Ejemplo n.º 4
0
 public function init()
 {
     $path = Yii::app()->getRuntimePath() . DS . "wap";
     if (!file_exists($path)) {
         @mkdir($path, 0777, true);
     }
     if ($this->getLogPath() === null) {
         $this->setLogPath($path);
     }
     parent::init();
 }
Ejemplo n.º 5
0
 /**
  * Retrieves filtered log messages from logger for further processing.
  * @param CLogger $logger logger instance
  * @param boolean $processLogs whether to process the logs after they are collected from the logger. ALWAYS TRUE NOW!
  */
 public function collectLogs($logger, $processLogs = false)
 {
     parent::collectLogs($logger, true);
 }
Ejemplo n.º 6
0
 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     parent::init();
     $this->levels = CLogger::LEVEL_PROFILE;
 }
Ejemplo n.º 7
0
 protected function formatLogMessage($message, $level, $category, $time)
 {
     $user = Yii::app()->user;
     $userName = $user == null ? 'guest' : $user->name;
     return parent::formatLogMessage('[' . HU::getUserIp() . '] ' . $userName . ' ' . $message, $level, $category, $time);
 }
Ejemplo n.º 8
0
<section class="span-19">
<h4 class="pageTitle">服务器参数</h4>

<?php 
$log = new CFileLogRoute();
UtilHelper::dump($log->getLogFile());
?>
<ul id="sys-info">
	<li>系统类型及版本号:<?php 
echo php_uname();
?>
</li>
	<li>服务器解译引擎:<?php 
echo $_SERVER['SERVER_SOFTWARE'];
?>
</li>
	<li>域名:<?php 
echo $_SERVER["HTTP_HOST"];
?>
</li>
	<li>Zend 版本:<?php 
echo zend_version();
?>
</li>
	<li>PHP安装路径:<?php 
echo DEFAULT_INCLUDE_PATH;
?>
</li>
	<li>可用扩展:<?php 
var_dump(extension_loaded('id3'));
?>
Ejemplo n.º 9
0
 protected function formatLogMessage($message, $level, $category, $time)
 {
     if ($this->logOnlyQuery) {
         return $message . "\n";
     }
     return parent::formatLogMessage($message, $level, $category, $time);
 }