Skip to content

Instantly share code, notes, and snippets.

@zircote
Created July 2, 2011 22:30
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 zircote/1061734 to your computer and use it in GitHub Desktop.
Save zircote/1061734 to your computer and use it in GitHub Desktop.
A Prowl Log Writer for Zend_Log
<?php
$prowl = array(
'apikey' => '072a7159e...e36ebe57',
// 'apikey' => array('072a7159e...e36ebe57','072a7159e...e36ebe57','072a7159e...e36ebe57'), //for multi-keys
'priority' => Skulk_Client_Message::PRIORITY_EMERGENCY, // optional
'url' => 'http://www.zircote.com/admin/console', // optional url to forward the user to.
'event' => 'Error logging via Prowl with Zend_Log', // optional Your message header
// 'providerkey' => '072a7159e9e8f......e7765cd11c229e36ebe57' // optional
);
$prowlWriter = Skulk_Log_Writer_Prowl::factory($prowl);
$prowlWriter->addFilter(new Zend_Log_Filter_Priority(Zend_Log::EMERG));
$zendLog = new Zend_Log($prowlWriter);
$zendLog->info('This wont be sent');
$zendLog->emerg('this is a emerg test 1');
$zendLog->emerg('this is a emerg test 2 ');
$zendLog->emerg('this is a emerg test 3 ');
<?php
$prowl = array(
'apikey' => '072a7159e...e36ebe57',
'priority' => Skulk_Client_Message::PRIORITY_NORMAL,
'url' => 'http://www.zircote.com/admin/console',
'event' => 'Error logging via Prowl with Zend_Log',
// 'providerkey' => '072a7159e9e8f......e7765cd11c229e36ebe57'
);
$tansport = new Skulk_Mail_Transport_Prowl($prowl)
$mail = new Zend_Mail();
$mail->setBodyText('this is a skulk test')
->send($transport);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment