Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit ac142d279181d954b6b17b1cc726ceb7244fa31d 2 parents 5bf96de + 25e7891
Lennart Koopmann lennartkoopmann authored

Showing 2 changed files with 13 additions and 0 deletions. Show diff stats Hide diff stats

  1. +11 0 gelf.php
  2. +2 0  index.php
11 gelf.php
@@ -120,6 +120,12 @@ public function setLine($line)
120 120 $this->data["line"] = $line;
121 121 }
122 122
  123 + public function setAdditional($key, $value)
  124 + {
  125 + $key = str_replace (" ", "", $key);
  126 + $this->data[$key] = $value;
  127 + }
  128 +
123 129 public function getShortMessage()
124 130 {
125 131 return isset($this->data["short_message"]) ? $this->data["short_message"] : null;
@@ -154,5 +160,10 @@ public function getLine()
154 160 {
155 161 return isset($this->data["line"]) ? $this->data["line"] : null;
156 162 }
  163 +
  164 + public function getAdditional()
  165 + {
  166 + return isset($this->data[$key]) ? $this->data[$key] : null;
  167 + }
157 168
158 169 }
2  index.php
@@ -10,4 +10,6 @@
10 10 $gelf->setLevel(2);
11 11 $gelf->setFile('/var/www/example.php');
12 12 $gelf->setLine(1337);
  13 +$gelf->setAdditional("something", "foo");
  14 +$gelf->setAdditional("something_else", "bar");
13 15 $gelf->send();

0 comments on commit ac142d2

Please sign in to comment.
Something went wrong with that request. Please try again.