コード例 #1
0
 public static function getLog()
 {
     if (!self::$log) {
         $path = PhabricatorEnv::getEnvConfig('log.access.path');
         $format = PhabricatorEnv::getEnvConfig('log.access.format');
         $format = nonempty($format, "[%D]\t%p\t%h\t%r\t%u\t%C\t%m\t%U\t%R\t%c\t%T");
         // NOTE: Path may be null. We still create the log, it just won't write
         // anywhere.
         $log = id(new PhutilDeferredLog($path, $format))->setFailQuietly(true)->setData(array('D' => date('r'), 'h' => php_uname('n'), 'p' => getmypid(), 'e' => time()));
         self::$log = $log;
     }
     return self::$log;
 }
コード例 #2
0
 public static function getLog()
 {
     if (!self::$log) {
         $path = PhabricatorEnv::getEnvConfig('log.access.path');
         $format = PhabricatorEnv::getEnvConfig('log.access.format');
         $format = nonempty($format, "[%D]\t%p\t%h\t%r\t%u\t%C\t%m\t%U\t%R\t%c\t%T");
         if (!$path) {
             return null;
         }
         $log = new PhutilDeferredLog($path, $format);
         $log->setData(array('D' => date('r'), 'h' => php_uname('n'), 'p' => getmypid(), 'e' => time()));
         self::$log = $log;
     }
     return self::$log;
 }