core-tech / fuel-packages-sentry
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:fuel-package
Requires
- composer/installers: *
- raven/raven: dev-master
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
- Use composer https://packagist.org/packages/core-tech/fuel-packages-sentry
- git submodule
- Download zip
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);
}