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