Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

the long promised support for additional/user defined GELF fields. up…

…date your web interface + server, too
  • Loading branch information...
commit 25e7891e01d62b8595e5cb40fa7b0555e7289409 1 parent 2c50b88
Lennart Koopmann authored
Showing with 13 additions and 0 deletions.
  1. +11 −0 gelf.php
  2. +2 −0  index.php
View
11 gelf.php
@@ -111,6 +111,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;
@@ -145,5 +151,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
2  index.php
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.