Skip to content

kander-zz/ubelt-graylog2-logger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

What?

This is a library for PHP to log messages to Graylog2. It extends the Zend_Log classes so it can be integrated into your projects already using Zend_Log.

Usage:

$formatter = new UBelt_Zend_Log_Formatter_Gelf();
$writer = new UBelt_Zend_Log_Writer_Graylog2('my-facility', 'graylog-server');
$writer->setFormatter($formatter);
$log = new Zend_Log($writer);

Logging a simple message

$log->log('something simple');

Logging some additional info

$log->log('blah blah', Zend_Log::INFO, array(
    'full_message' => 'some more blah blah',
    'file' => __FILE__,
    'line' => __LINE__,
    'misc' => 'somemore fields' // you can pass additional data
);

About

PHP Logger using Zend Log Interfaces to log to a Graylog2 server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • PHP 100.0%