Esempio n. 1
0
 protected function _execute(array $options)
 {
     Kohana::$log->add(Log::ERROR, "Test error!");
     Kohana::$log->add(Log::WARNING, "Test warning!");
     Kohana::$log->add(Log::INFO, "Test info!");
     Raven::instance()->captureException(new Kohana_Minion_Exception_InvalidTask("That was invalid task message", array('variable' => 'value'), 451));
 }
Esempio n. 2
0
 public static function handler($e)
 {
     Raven::instance()->captureException($e);
     //Kohana handler adds a Log::ERROR string to log, so double-sending would be undesired
     Kohana::$log->detach(Log_Raven::instance());
     parent::handler($e);
     //there's death call
 }
Esempio n. 3
0
 public static function instance()
 {
     if (self::$instance === null) {
         $api = Kohana::$config->load('raven.api');
         if ($api === null) {
             throw new RuntimeException("Could not find Sentry API key. Please setup config/raven");
         }
         self::$instance = new Raven_Client($api);
     }
     return self::$instance;
 }
Esempio n. 4
0
 public function write(array $messages)
 {
     if (count($messages) == 0) {
         return;
     }
     if (!Kohana::$config->load('raven.enabled')) {
         return;
     }
     $r = Raven::instance();
     foreach ($messages as $message) {
         $r->captureMessage($message['body'], null, $r->translateSeverity($message['level']));
     }
 }
Esempio n. 5
0
<?php

defined('SYSPATH') or die('No direct script access.');
require_once Kohana::find_file('vendor', 'lib/Raven/Autoloader');
Raven_Autoloader::register();
Raven::instance()->registerSeverityMap(array(Log::EMERGENCY => Raven_Client::FATAL, Log::ALERT => Raven_Client::FATAL, Log::CRITICAL => Raven_Client::FATAL, Log::ERROR => Raven_Client::ERROR, Log::WARNING => Raven_Client::WARN, Log::NOTICE => Raven_Client::INFO, Log::INFO => Raven_Client::INFO, Log::DEBUG => Raven_Client::DEBUG, Log::STRACE => Raven_Client::DEBUG));