Просмотр исходного кода

contentPrefix should be contextPrefix

Matt Lehner 13 лет назад
Родитель
Сommit
97b65bc3e4
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      src/Monolog/Formatter/GelfMessageFormatter.php

+ 4 - 4
src/Monolog/Formatter/GelfMessageFormatter.php

@@ -34,7 +34,7 @@ class GelfMessageFormatter implements FormatterInterface
     /**
      * @var string a prefix for 'context' fields from the Monolog record (optional)
      */
-    protected $contentPrefix;
+    protected $contextPrefix;
     
     /**
      * Translates Monolog log levels to Graylog2 log priorities.
@@ -48,12 +48,12 @@ class GelfMessageFormatter implements FormatterInterface
         Logger::ALERT    => LOG_ALERT,
     );
 
-    public function __construct($systemName = null, $extraPrefix = null, $contentPrefix = 'ctxt_')
+    public function __construct($systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_')
     {
         $this->systemName = $systemName ?: gethostname();
 
         $this->extraPrefix = $extraPrefix;
-        $this->contentPrefix = $contentPrefix;
+        $this->contextPrefix = $contextPrefix;
     }
 
     /**
@@ -80,7 +80,7 @@ class GelfMessageFormatter implements FormatterInterface
         }
 
         foreach ($record['context'] as $key => $val) {
-            $message->setAdditional($this->contentPrefix . $key, is_scalar($val) ? $val : json_encode($val));
+            $message->setAdditional($this->contextPrefix . $key, is_scalar($val) ? $val : json_encode($val));
         }
 
         return $message;