library beanstalkhandler
Sends your logs to files, sockets, inboxes, databases and various web services
sudhaus7/beanstalkhandler
Sends your logs to files, sockets, inboxes, databases and various web services
- Thursday, June 21, 2018
- by sudhaus7
- Repository
- 2 Watchers
- 0 Stars
- 0 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
beanstalkhandler
A Monolog Handler to push logs to a Beanstalk instance, (*1)
Usage, (*2)
// Get a Beanstalk Connection
$beanstalk = new \Pheanstalk\Pheanstalk('127.0.0.1');
// Create a the Handler
$handler = new \Sudhaus7\Monolog\BeanstalkHandler($beanstalk,'logtube');
// Create a Logger
$logger = new \Monolog\Logger('debug');
$logger->pushHandler($handler);
// Log some data
$logger->debug('I am debug', array('productId' => 123));
This is a fast and nonblocking way to log data. Just do not forget to get the data out of beanstalk later.
This is very convinient, (*3)