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


PHP newrelic_notice_error函數代碼示例

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


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

示例1: noticeError

 /**
  * Report an error at this line of code, with a complete stack trace.
  *
  * @param string $message
  * @param \Exception|\Throwable $exception
  *
  * @return $this
  */
 public function noticeError($message, $exception)
 {
     if ($this->active) {
         newrelic_notice_error($message, $exception);
     }
     return $this;
 }
開發者ID:spryker,項目名稱:NewRelic,代碼行數:15,代碼來源:NewRelicApi.php

示例2: _write

 /**
  * Write the log message to the file path set
  * in this writer.
  */
 public function _write($event)
 {
     //Ignore Exceptions New Relic Catches these on it's own
     if (preg_match('/Uncaught ([A-Za-z]*)Exception: /', trim($errstr)) == true) {
         return;
     }
     $errno = $event['message']['errno'];
     $errstr = $event['message']['errstr'];
     $errfile = $event['message']['errfile'];
     $errline = $event['message']['errline'];
     $errcontext = $event['message']['errcontext'];
     switch ($event['priorityName']) {
         case 'ERR':
             $errtype = 'Error';
             break;
         case 'WARN':
             $errtype = 'Warning';
             break;
         case 'NOTICE':
             $errtype = 'Notice';
             break;
         default:
             $errtype = $event['priorityName'];
     }
     $relfile = Director::makeRelative($errfile);
     if ($relfile && $relfile[0] == '/') {
         $relfile = substr($relfile, 1);
     }
     //If it's not an exception notice the error
     newrelic_notice_error($errno, "[{$errtype}] {$errstr} in {$relfile} line {$errline}", $errfile, $errline, $errcontext);
 }
開發者ID:webbuilders-group,項目名稱:silverstripe-new-relic,代碼行數:35,代碼來源:NewRelicErrorLogger.php

示例3: __invoke

 /**
  * @param \Nette\Application\Application $application
  * @param \Exception|\Throwable $e
  */
 public function __invoke(Application $application, $e)
 {
     if ($e instanceof \Nette\Application\BadRequestException) {
         // skip 4xx errors
         return;
     }
     newrelic_notice_error($e->getMessage(), $e);
 }
開發者ID:vrtak-cz,項目名稱:newrelic-nette,代碼行數:12,代碼來源:OnErrorCallback.php

示例4: onError

 public function onError(Application $app, \Exception $e)
 {
     if ($e instanceof BadRequestException) {
         return;
         // ignore
     }
     newrelic_notice_error($e->getMessage(), $e);
 }
開發者ID:bazo,項目名稱:nette-newrelic-extension,代碼行數:8,代碼來源:NewRelicProfiler.php

示例5: onError

 public function onError(Application $app, \Exception $e)
 {
     if (!extension_loaded('newrelic')) {
         return;
     }
     if ($e instanceof Nette\Application\BadRequestException) {
         return;
     }
     newrelic_notice_error($e->getMessage(), $e);
 }
開發者ID:enumag,項目名稱:newrelic-nette-1,代碼行數:10,代碼來源:NewRelicProfilingListener.php

示例6: log

 protected function log($message, $type = 'notice', $exception = null)
 {
     $typeMap = array('error' => E_USER_ERROR, 'warning' => E_USER_WARNING, 'notice' => E_USER_NOTICE);
     file_put_contents(dirname(__FILE__) . '/../../../../error.log', $message . $exception, FILE_APPEND);
     error_log($message, $typeMap[$type]);
     if (extension_loaded('newrelic')) {
         newrelic_notice_error($message, $exception);
     }
     return $this;
 }
開發者ID:jamwaffles,項目名稱:pliers,代碼行數:10,代碼來源:App.php

示例7: handle

 /**
  * Handles a given exception
  *
  * @param Throwable|Exception $exception A Throwable or Exception instance
  * @return void
  */
 public function handle($exception)
 {
     $exception = call_user_func($this->config('exceptionCallback'), $exception);
     if (!$exception) {
         return;
     }
     if (extension_loaded('newrelic')) {
         newrelic_notice_error($exception);
     }
 }
開發者ID:josegonzalez,項目名稱:php-error-handlers,代碼行數:16,代碼來源:NewrelicHandler.php

示例8: log

 public function log($message, $priority = self::INFO)
 {
     $res = parent::log($message, $priority);
     if ($priority === self::ERROR || $priority === self::CRITICAL) {
         if (is_array($message)) {
             $message = implode(' ', $message);
         }
         newrelic_notice_error($message);
     }
     return $res;
 }
開發者ID:enumag,項目名稱:newrelic-nette-1,代碼行數:11,代碼來源:Logger.php

示例9: noticeError

 /**
  * {@inheritdoc}
  */
 public function noticeError($message, $exception = null)
 {
     if (!$this->extensionLoaded()) {
         return;
     }
     if (!$exception) {
         newrelic_notice_error($message);
     } else {
         newrelic_notice_error($message, $exception);
     }
 }
開發者ID:neeckeloo,項目名稱:newrelic,代碼行數:14,代碼來源:Client.php

示例10: pushEvent

 /**
  * Static since a store config exception (caused by a module config error) cannot call magento's model objects.
  * If a store config exception occurs, the exception class logs it drect.
  * 
  * @param type $e
  */
 public static function pushEvent($e, $setAppName = true)
 {
     if (extension_loaded('newrelic')) {
         $message = $e->getMessage();
         $message = empty($message) ? get_class($e) : $message;
         if ($setAppName) {
             Mage::Helper('newrelic')->setAppName();
         }
         newrelic_notice_error($message, $e);
     }
 }
開發者ID:Bobspadger,項目名稱:NewRelic,代碼行數:17,代碼來源:Exception.php

示例11: log

 /**
  * @param string|array $message
  * @param string $priority
  * @return string logged error filename
  */
 public function log($message, $priority = NULL)
 {
     $exceptionFile = $this->oldLogger->log($message, $priority);
     if (in_array($priority, $this->logLevels)) {
         if (is_array($message)) {
             $message = implode(' ', $message);
         }
         newrelic_notice_error($message);
     }
     return $exceptionFile;
 }
開發者ID:vrtak-cz,項目名稱:newrelic-tracy,代碼行數:16,代碼來源:Logger.php

示例12: recordEvent

 /**
  * Record a log event to new relic
  * 
  * @param type $event
  * @return type
  */
 public function recordEvent($event)
 {
     if (extension_loaded('newrelic')) {
         if (Mage::getStoreConfig('newrelic/settings/record_system_log') && !Mage::helper('newrelic')->ignoreMessage($event['message'], 'system_log')) {
             if ($event['priorityName'] == 'DEBUG' && Mage::getStoreConfig('newrelic/settings/system_log_ignore_debug')) {
                 return;
             }
             Mage::Helper('newrelic')->setAppName();
             newrelic_notice_error($this->_eventType . ': [' . $event['priorityName'] . '] ' . $event['message']);
         }
     }
 }
開發者ID:Bobspadger,項目名稱:NewRelic,代碼行數:18,代碼來源:System.php

示例13: log

 public function log($message, $priority = self::INFO)
 {
     if (!extension_loaded('newrelic')) {
         return;
     }
     if ($priority === self::ERROR || $priority === self::CRITICAL) {
         if (is_array($message)) {
             $message = implode(' ', $message);
         }
         newrelic_notice_error($message);
     }
 }
開發者ID:bazo,項目名稱:nette-newrelic-extension,代碼行數:12,代碼來源:NewRelicLogger.php

示例14: noticeException

 /**
  * @param array $record
  */
 private function noticeException(array &$record)
 {
     if (!empty($record['exception']) && $record['exception'] instanceof \Exception) {
         newrelic_notice_error($record['exception']->getMessage(), $record['exception']);
         unset($record['exception']);
     } elseif (!empty($record['context']['exception']) && $record['context']['exception'] instanceof \Exception) {
         newrelic_notice_error($record['context']['exception']->getMessage(), $record['context']['exception']);
         unset($record['context']['exception']);
     } elseif (!empty($record['extra']['exception']) && $record['extra']['exception'] instanceof \Exception) {
         newrelic_notice_error($record['extra']['exception']->getMessage(), $record['extra']['exception']);
         unset($record['extra']['exception']);
     } elseif (!empty($record['message'])) {
         newrelic_notice_error($record['message']);
     }
 }
開發者ID:mobly,項目名稱:logger,代碼行數:18,代碼來源:NewRelicHandler.php

示例15: write

 /**
  * @param array $record
  * @throws Exception\RuntimeException
  */
 public function write(array $record)
 {
     if (!$this->isEnabled()) {
         throw new Exception\RuntimeException('The newrelic PHP extension is required to use the NewRelicHandler');
     }
     if ($name = $this->getName($record['context'])) {
         $this->setName($name);
     }
     if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Exception) {
         newrelic_notice_error($record['message'], $record['context']['exception']);
         unset($record['context']['exception']);
     } else {
         newrelic_notice_error($record['message']);
     }
     foreach ($record['context'] as $key => $parameter) {
         newrelic_add_custom_parameter($key, $parameter);
     }
 }
開發者ID:sullenboom,項目名稱:sla-healthcheck,代碼行數:22,代碼來源:Handler.php


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