当前位置: 首页>>代码示例>>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;未经允许,请勿转载。