core-tech/fuel-packages-sentry

1.0.2 2013-05-20 06:39 UTC

This package is not auto-updated.

Last update: 2024-12-02 13:52:58 UTC


README

Sentry is a realtime event logging. This package corresponds to PHP and Javascript.

Install

Setup to fuel/packages/sentry

If you use git submodule or download zip, you must install vendors

$ cd fuel/packages/sentry
$ php composer.phar install

Configuration

In app/config/config.php

'always_load' => array('packages' => array(
	'sentry',
	...

Copy packages/sentry/config/sentry.php to under app/config directory and edit

PHP error is automatically send by Error class that has been overridden

JS error is needs the following code in head tag to automatically send

<?php echo Sentry::get_raven_client(); ?>

Example

PHP

Add option and manually logging
// Send exception
$opt = array('tags' => array('MyTag' => 'MyTag Message'));
Sentry::send_exception(new Exception('message'), $opt);

// Send message
$opt = array('tags' => array('MyTag' => 'MyTag Message'));
Sentry::send_message('message', $opt);
Sentry::send_message('%04d-%02d-%02d', $opt, array(2013,4,1));

For more information, see raven-php

Javascript

Add option
<?php echo Sentry::get_raven_client(array('logger' => 'MyLogger')); ?>

For more information, see raven-js

Manually logging
try {
	errorThrowingCode();
} catch(e) {
	Raven.captureException(e);
}