library campfire-monolog-handler
A handler for Monolog that sends messages to a Campfire room.
dbarbar/campfire-monolog-handler
A handler for Monolog that sends messages to a Campfire room.
- Monday, January 21, 2013
- by dbarbar
- Repository
- 1 Watchers
- 0 Stars
- 3 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 3 Versions
- 0 % Grown
Monolog Handler for posting to Campfire
This is my first attempt at making a Campfire handler for Monolog., (*1)
Build Status
, (*2)
Installation
Add "dbarbar/campfire-monolog-handler": "dev-master" to the require section of your composer.json., (*3)
Usage Example
use Monolog\Logger;
use dbarbar\CampfireHandler;
use rcrowe\Campfire;
// create a log channel
$log = new Logger('My Channel');
$campfireConfig = array(
'key' => 'campfire token',
'room' => 'room id number',
'subdomain' => 'sudbdomain/account name',
);
/**
* Parameters to CampfireHandler()
* Instance of the Campfire object.
* Minimum level to log. Defaults to Logger::DEBUG.
* Bubble boolean. Defaults to true.
* (Don't bubble up the message if this handler handles it.)
*/
$handler = new CampfireHandler(new Campfire($campfireConfig));
$log->pushHandler($handler);
// add records to the log
$log->warning('Foo');
$log->error('Bar');