EmailLog is a project mainly written in PHP, it's free.
Email storage stream for Logging on CakePHP 2.x
Send log by email using one of configured EmailConfig
in app/Config/email.php
Add to app bootstrap:
<?php
CakePlugin::load('EmailLog');
App::uses('CakeLog', 'Log');
CakeLog::config('email', array(
'engine' => 'EmailLog.EmailLog',
'emailConfig' => 'default', // optional
'subjectFormat' => ':type :date @ :host', // optional
'logTypes' => array('info', 'notice', 'warrning', 'debug', 'error') // optional
));
Cake will autoconfigure file log, but only if there's no already configured handlers. So append file config too:
CakeLog::config('file', array('engine' => 'FileLog'));
Test it now in controller:
CakeLog::write('error', 'Missing key: '. print_r($this->request, true));
PHP version: PHP 5.2+
CakePHP version: 2.x