Overload Kohana Logging

Need to write Kohana logs somewhere other than the default location? Or send an e-mail or something?

You can use the system.log event to do this.

Put this in your controller:

function custom_log()
{
  error_log(Event::$data[0] . ' ' . Event::$data[1] . ' ' . Event::$data[2]);
}

Event::add('system.log', 'custom_log');

Now when you call Kohana::log, the message will get written out to the PHP error log.