Ver Fonte

Add method for adding additional tags to Loggly handler

Arnas L há 11 anos atrás
pai
commit
12987cfa51
1 ficheiros alterados com 7 adições e 0 exclusões
  1. 7 0
      src/Monolog/Handler/LogglyHandler.php

+ 7 - 0
src/Monolog/Handler/LogglyHandler.php

@@ -46,6 +46,13 @@ class LogglyHandler extends AbstractProcessingHandler
         $this->tag = $tag;
     }
 
+    public function addTag($tag)
+    {
+        $tags = (strlen($this->tag) > 0) ? explode(',', $this->tag) : array();
+        $tags[] = $tag;
+        $this->tag = implode(',', $tags);
+    }
+
     protected function write(array $record)
     {
         $this->send($record["formatted"], self::ENDPOINT_SINGLE);