Skip to content

Instantly share code, notes, and snippets.

@lennartkoopmann
Created October 24, 2010 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lennartkoopmann/643481 to your computer and use it in GitHub Desktop.
Save lennartkoopmann/643481 to your computer and use it in GitHub Desktop.
Example usage of PHP GELF libary
<?php
require('gelf.php');
$gelf = new GELFMessage('localhost', 12201);
$gelf->setShortMessage('Something is broken');
$gelf->setFullMessage("Stacktrace\n\nmore stuff");
$gelf->setHost('my-app');
$gelf->setLevel(1);
$gelf->setFile('/var/www/example.php');
$gelf->setLine(1337);
$gelf->setAdditional("Something", "Foo");
$gelf->setAdditional("Something else", "Bar");
$gelf->send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment