本文整理汇总了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);
}
}
示例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;
}