Exemplo n.º 1
0
 /**
  * [write 根据日志类型写到不同的日志文件]
  * @return [type] [description]
  */
 public function write()
 {
     $text = $this->processLogs();
     $text["application"] .= "[" . $_SERVER['REQUEST_URI'] . "] " . "[runing time]: " . (microtime(true) - YCF_BEGIN_TIME) . "\n";
     foreach ($text as $key => $value) {
         if (empty($key)) {
             continue;
         }
         $fileName = $this->_logPath . $key . '.log';
         $fp2 = fopen($fileName, "a+") or YcfUtils::exit("Log fatal Error !");
         fwrite($fp2, $value);
         fclose($fp2);
     }
 }
Exemplo n.º 2
0
 /**
  * [write 根据日志类型写到不同的日志文件]
  * @return [type] [description]
  */
 public function write($logsAll)
 {
     if (empty($logsAll)) {
         return;
     }
     $this->logPath = ROOT_PATH . 'src/runtime/';
     if (!is_dir($this->logPath)) {
         self::mkdir($this->logPath, array(), true);
     }
     foreach ($logsAll as $key => $value) {
         if (empty($key)) {
             continue;
         }
         $fileName = $this->logPath . $key . '.log';
         $fp2 = @fopen($fileName, "a+") or YcfUtils::exitMsg("Log fatal Error !");
         @fwrite($fp2, $value);
         @fclose($fp2);
     }
 }