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


PHP Logger::getZendLoggerPsr3Mapping方法代碼示例

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


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

示例1: setFilterPriority

 /**
  * @deprecated
  * @param $level
  */
 public function setFilterPriority($level)
 {
     // legacy ZF method
     $zendLoggerPsr3Mapping = Logger::getZendLoggerPsr3Mapping();
     if (isset($zendLoggerPsr3Mapping[$level])) {
         $level = $zendLoggerPsr3Mapping[$level];
         $this->setLevel($level);
     }
 }
開發者ID:pimcore,項目名稱:pimcore,代碼行數:13,代碼來源:ApplicationLoggerDb.php

示例2: log

 /**
  * @param mixed $level
  * @param string $message
  * @param array $context
  * @return null
  */
 public function log($level, $message, array $context = [])
 {
     if (!isset($context["component"])) {
         $context["component"] = $this->component;
     }
     if (!isset($context["fileObject"]) && $this->fileObject) {
         $context["fileObject"] = $this->fileObject;
     }
     if (isset($context["fileObject"])) {
         if (is_string($context["fileObject"])) {
             $context["fileObject"] = \Pimcore\Tool::getHostUrl() . "/" . str_replace(PIMCORE_DOCUMENT_ROOT, '', $context["fileObject"]);
         } else {
             $context["fileObject"] = \Pimcore\Tool::getHostUrl() . "/" . str_replace(PIMCORE_DOCUMENT_ROOT, '', $context["fileObject"]->getFilename());
         }
     }
     $relatedObject = null;
     if (isset($context["relatedObject"])) {
         $relatedObject = $context["relatedObject"];
     }
     if (!$relatedObject && $this->relatedObject) {
         $relatedObject = $this->relatedObject;
     }
     if ($relatedObject) {
         if ($relatedObject instanceof \Pimcore\Model\Object\AbstractObject or $relatedObject instanceof \Pimcore\Model\Document or $relatedObject instanceof \Pimcore\Model\Asset) {
             $relatedObject = $relatedObject->getId();
         }
         if (is_numeric($relatedObject)) {
             $context["relatedObject"] = $relatedObject;
             $context["relatedObjectType"] = $this->relatedObjectType;
         }
     }
     $context['source'] = $this->resolveLoggingSource();
     foreach ($this->loggers as $logger) {
         if ($logger instanceof \Psr\Log\LoggerInterface) {
             $logger->log($level, $message, $context);
         } elseif ($logger instanceof \Zend_Log) {
             // zf compatibility
             $zendLoggerPsr3Mapping = array_flip(Logger::getZendLoggerPsr3Mapping());
             $prio = $zendLoggerPsr3Mapping[$level];
             $logger->log($message, $prio, $context);
         }
     }
     return null;
 }
開發者ID:pimcore,項目名稱:pimcore,代碼行數:50,代碼來源:ApplicationLogger.php


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