當前位置: 首頁>>代碼示例>>PHP>>正文


PHP LoggerLoggingEvent類代碼示例

本文整理匯總了PHP中LoggerLoggingEvent的典型用法代碼示例。如果您正苦於以下問題:PHP LoggerLoggingEvent類的具體用法?PHP LoggerLoggingEvent怎麽用?PHP LoggerLoggingEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了LoggerLoggingEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: convert

 public function convert(LoggerLoggingEvent $event)
 {
     if ($this->useLocalDate) {
         return $this->date($this->format, $event->getTimeStamp());
     }
     return date($this->format, $event->getTimeStamp());
 }
開發者ID:HaakonME,項目名稱:noark5-validator,代碼行數:7,代碼來源:LoggerPatternConverterDate.php

示例2: convert

 /**
  * @param LoggerLoggingEvent $event
  * @return string
  */
 public function convert($event)
 {
     $timeStamp = $event->getTimeStamp();
     $usecs = round(($timeStamp - (int) $timeStamp) * 1000);
     $this->df = preg_replace('/((?<!\\\\)(?:\\\\{2})*)u/', '${1}' . sprintf('%03d', $usecs), $this->df);
     return date($this->df, $event->getTimeStamp());
 }
開發者ID:BGCX067,項目名稱:ezboss-svn-to-git,代碼行數:11,代碼來源:LoggerDatePatternConverter.php

示例3: append

 /**
  * Appends a logging event.
  *
  * If the target file changes because of passage of time (e.g. at midnight)
  * the current file is closed. A new file, with the new date, will be
  * opened by the write() method.
  */
 public function append(LoggerLoggingEvent $event)
 {
     $eventDate = $this->getDate($event->getTimestamp());
     // Initial setting of current date
     if (!isset($this->currentDate)) {
         $this->currentDate = $eventDate;
     } else {
         if ($this->currentDate !== $eventDate) {
             $this->currentDate = $eventDate;
             // Close the file if it's open.
             // Note: $this->close() is not called here because it would set
             //       $this->closed to true and the appender would not recieve
             //       any more logging requests
             if (is_resource($this->fp)) {
                 $this->write($this->layout->getFooter());
                 fclose($this->fp);
             }
             $this->fp = null;
         }
     }
     //$this->rollOver();
     //var_dump($this);
     //parent::append($event);
     $this->write($this->layout->getFooter());
 }
開發者ID:dru-id,項目名稱:druid-php-sdk,代碼行數:32,代碼來源:LoggerAppenderDailyRollingFile.php

示例4: format

 public function format(LoggerLoggingEvent $event)
 {
     // If required, initialize the location data
     if ($this->locationInfo) {
         $event->getLocationInformation();
     }
     return serialize($event) . PHP_EOL;
 }
開發者ID:HaakonME,項目名稱:noark5-validator,代碼行數:8,代碼來源:LoggerLayoutSerialized.php

示例5: convert

 public function convert(LoggerLoggingEvent $event)
 {
     $info = $event->getThrowableInformation();
     if (isset($info)) {
         $ex = $info->getThrowable();
         return (string) $ex . PHP_EOL;
     }
     return '';
 }
開發者ID:keehao,項目名稱:Php-Object-Framework,代碼行數:9,代碼來源:LoggerPatternConverterThrowable.php

示例6: convert

 public function convert(LoggerLoggingEvent $event)
 {
     $info = $event->getThrowableInformation();
     if (isset($info)) {
         $ex = $info->getThrowable();
         return $this->getExceptionTraceAsString($ex) . PHP_EOL;
     }
     return '';
 }
開發者ID:Vbyec,項目名稱:frame,代碼行數:9,代碼來源:LoggerPatternConverterThrowable.php

示例7: decide

 /**
  * @return integer a {@link LOGGER_FILTER_NEUTRAL} is there is no string match.
  */
 public function decide(LoggerLoggingEvent $event)
 {
     $msg = $event->getRenderedMessage();
     if ($msg === null or $this->stringToMatch === null) {
         return LoggerFilter::NEUTRAL;
     }
     if (strpos($msg, $this->stringToMatch) !== false) {
         return $this->acceptOnMatch ? LoggerFilter::ACCEPT : LoggerFilter::DENY;
     }
     return LoggerFilter::NEUTRAL;
 }
開發者ID:jjaferson,項目名稱:ourives,代碼行數:14,代碼來源:LoggerFilterStringMatch.php

示例8: decide

 /**
  * Return the decision of this filter.
  * 
  * Returns {@link LoggerFilter::NEUTRAL} if the <b><var>LevelToMatch</var></b>
  * option is not set or if there is not match.	Otherwise, if there is a
  * match, then the returned decision is {@link LoggerFilter::ACCEPT} if the
  * <b><var>AcceptOnMatch</var></b> property is set to <i>true</i>. The
  * returned decision is {@link LoggerFilter::DENY} if the
  * <b><var>AcceptOnMatch</var></b> property is set to <i>false</i>.
  *
  * @param LoggerLoggingEvent $event
  * @return integer
  */
 public function decide(LoggerLoggingEvent $event)
 {
     if ($this->levelToMatch === null) {
         return LoggerFilter::NEUTRAL;
     }
     if ($this->levelToMatch->equals($event->getLevel())) {
         return $this->acceptOnMatch ? LoggerFilter::ACCEPT : LoggerFilter::DENY;
     } else {
         return LoggerFilter::NEUTRAL;
     }
 }
開發者ID:dobreapa,項目名稱:owasp-esapi-php,代碼行數:24,代碼來源:LoggerFilterLevelMatch.php

示例9: decide

 /**
  * @return integer a {@link LOGGER_FILTER_NEUTRAL} is there is no string match.
  */
 function decide(LoggerLoggingEvent $event)
 {
     $category = $event->getLoggerName();
     if ($category === null or $this->stringToMatch === null) {
         return LoggerFilter::NEUTRAL;
     }
     if (preg_match($this->stringToMatch, $category)) {
         return $this->acceptOnMatch ? LoggerFilter::ACCEPT : LoggerFilter::NEUTRAL;
     } else {
         return LoggerFilter::DENY;
     }
 }
開發者ID:rickb838,項目名稱:scalr,代碼行數:15,代碼來源:class.LoggerFilterCategoryMatch.php

示例10: convert

 public function convert(LoggerLoggingEvent $event)
 {
     $name = $event->getLocationInformation()->getClassName();
     if (!isset($this->cache[$name])) {
         // If length is set return shortened class name
         if (isset($this->length)) {
             $this->cache[$name] = LoggerUtils::shortenClassName($name, $this->length);
         } else {
             $this->cache[$name] = $name;
         }
     }
     return $this->cache[$name];
 }
開發者ID:ActiveWebsite,項目名稱:BoojPressPlugins,代碼行數:13,代碼來源:LoggerPatternConverterClass.php

示例11: append

 public function append(LoggerLoggingEvent $event)
 {
     $level = $event->getLevel();
     if ($level->isGreaterOrEqual(LoggerLevel::getLevelError())) {
         trigger_error($this->layout->format($event), E_USER_ERROR);
     } else {
         if ($level->isGreaterOrEqual(LoggerLevel::getLevelWarn())) {
             trigger_error($this->layout->format($event), E_USER_WARNING);
         } else {
             trigger_error($this->layout->format($event), E_USER_NOTICE);
         }
     }
 }
開發者ID:josefd8,項目名稱:dashboardWeb,代碼行數:13,代碼來源:LoggerAppenderPhp.php

示例12: convert

 public function convert(LoggerLoggingEvent $event)
 {
     if (isset($this->key)) {
         return $event->getMDC($this->key);
     } else {
         $buff = array();
         $map = $event->getMDCMap();
         foreach ($map as $key => $value) {
             $buff[] = "{$key}={$value}";
         }
         return implode(', ', $buff);
     }
 }
開發者ID:gustavoghioldi,項目名稱:Plugin-opencart2,代碼行數:13,代碼來源:LoggerPatternConverterMDC.php

示例13: append

 public function append(LoggerLoggingEvent $event)
 {
     $log = new StdClass();
     $log->time = $event->getTimeStamp();
     $log->level = $event->getLevel()->toString();
     $log->msg = $event->getMessage();
     $log->logger = $event->getLoggerName();
     $this->logBuffer[] = $log;
     $this->emitter->emit('event', array($log));
     if (count($this->logBuffer) > $this->logLimit) {
         array_shift($this->logBuffer);
     }
 }
開發者ID:unkerror,項目名稱:Budabot,代碼行數:13,代碼來源:LoggerAppenderBuffer.php

示例14: testGetStartTime

 public function testGetStartTime()
 {
     $time = LoggerLoggingEvent::getStartTime();
     self::assertInternalType('float', $time);
     $time2 = LoggerLoggingEvent::getStartTime();
     self::assertEquals($time, $time2);
 }
開發者ID:keehao,項目名稱:Php-Object-Framework,代碼行數:7,代碼來源:LoggerLoggingEventTest.php

示例15: convert

 /**
  * @param LoggerLoggingEvent $event
  * @return string
  */
 public function convert($event)
 {
     $locationInfo = $event->getLocationInformation();
     switch ($this->type) {
         case LoggerPatternParser::LOG4PHP_LOGGER_PATTERN_PARSER_FULL_LOCATION_CONVERTER:
             return $locationInfo->getFullInfo();
         case LoggerPatternParser::LOG4PHP_LOGGER_PATTERN_PARSER_METHOD_LOCATION_CONVERTER:
             return $locationInfo->getMethodName();
         case LoggerPatternParser::LOG4PHP_LOGGER_PATTERN_PARSER_LINE_LOCATION_CONVERTER:
             return $locationInfo->getLineNumber();
         case LoggerPatternParser::LOG4PHP_LOGGER_PATTERN_PARSER_FILE_LOCATION_CONVERTER:
             return $locationInfo->getFileName();
         default:
             return '';
     }
 }
開發者ID:dobreapa,項目名稱:owasp-esapi-php,代碼行數:20,代碼來源:LoggerLocationPatternConverter.php


注:本文中的LoggerLoggingEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。