Permalink
Browse files

Merge branch 'master' of github.com:Graylog2/gelf-php

  • Loading branch information...
lennartkoopmann committed Nov 13, 2010
2 parents 5bf96de + 25e7891 commit ac142d279181d954b6b17b1cc726ceb7244fa31d
Showing with 13 additions and 0 deletions.
  1. +11 −0 gelf.php
  2. +2 −0 index.php
View
@@ -120,6 +120,12 @@ public function setLine($line)
$this->data["line"] = $line;
}
+ public function setAdditional($key, $value)
+ {
+ $key = str_replace (" ", "", $key);
+ $this->data[$key] = $value;
+ }
+
public function getShortMessage()
{
return isset($this->data["short_message"]) ? $this->data["short_message"] : null;
@@ -154,5 +160,10 @@ public function getLine()
{
return isset($this->data["line"]) ? $this->data["line"] : null;
}
+
+ public function getAdditional()
+ {
+ return isset($this->data[$key]) ? $this->data[$key] : null;
+ }
}
View
@@ -10,4 +10,6 @@
$gelf->setLevel(2);
$gelf->setFile('/var/www/example.php');
$gelf->setLine(1337);
+$gelf->setAdditional("something", "foo");
+$gelf->setAdditional("something_else", "bar");
$gelf->send();

0 comments on commit ac142d2

Please sign in to comment.