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


PHP LoggerLoggingEvent::getThrowableInformation方法代碼示例

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


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

示例1: 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

示例2: 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

示例3: format

 /**
  * Converts the logging event into an array which can be logged to mongodb.
  * 
  * @param LoggerLoggingEvent $event
  * @return array The array representation of the logging event.
  */
 protected function format(LoggerLoggingEvent $event)
 {
     $timestampSec = (int) $event->getTimestamp();
     $timestampUsec = (int) (($event->getTimestamp() - $timestampSec) * 1000000);
     $document = array('timestamp' => new MongoDate($timestampSec, $timestampUsec), 'level' => $event->getLevel()->toString(), 'thread' => (int) $event->getThreadName(), 'message' => $event->getMessage(), 'loggerName' => $event->getLoggerName());
     $locationInfo = $event->getLocationInformation();
     if ($locationInfo != null) {
         $document['fileName'] = $locationInfo->getFileName();
         $document['method'] = $locationInfo->getMethodName();
         $document['lineNumber'] = $locationInfo->getLineNumber() == 'NA' ? 'NA' : (int) $locationInfo->getLineNumber();
         $document['className'] = $locationInfo->getClassName();
     }
     $throwableInfo = $event->getThrowableInformation();
     if ($throwableInfo != null) {
         $document['exception'] = $this->formatThrowable($throwableInfo->getThrowable());
     }
     return $document;
 }
開發者ID:alexandreannic,項目名稱:android-holo-colors,代碼行數:24,代碼來源:LoggerAppenderMongoDB.php

示例4: format

 public function format(LoggerLoggingEvent $event)
 {
     LoggerLoggingEventTest::$locationInfo = $event->getLocationInformation();
     LoggerLoggingEventTest::$throwableInfo = $event->getThrowableInformation();
 }
開發者ID:keehao,項目名稱:Php-Object-Framework,代碼行數:5,代碼來源:LoggerLoggingEventTest.php


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