Ca va ENCORE parler de bits!

2014-04-12  |  Tips 'n' Tricks  |  administration sentry system

Sentry is a realtime errors manager for connected application that help to know easily which problem are recurrent in a software. This opensource project present a very light web interface to track errors efficiently and freely.

Installation

First, you have to install nodejs. Following, a repository to get script to do it :

$> git clone https://github.com/42antoine/nodeautoinstall
$> cd nodeautoinstall
$> sudo python ./nodeautoinstall.py

Next, install python PIP libraries

$> sudo apt-get install python-pip python-dev build-essential 
$> sudo pip install --upgrade pip 
$> sudo pip install --upgrade virtualenv

Now we can start to install Sentry

$> git clone https://github.com/getsentry/sentry
$> cd sentry
#> make
#> ./setup.py build
#> ./setup.py install

At this point, you can now use 'sentry' as shell command. With this binary, we will generate the configuration file for the manager.

#> sentry init /etc/sentry.conf.py

The configuration file have to be edited to set your domain parameters :

SENTRY_URL_PREFIX = 'https://MY_DOMAIN.com'
  
SENTRY_WEB_HOST = 'HOST_IP'
SENTRY_WEB_PORT = SENTRY_HOST_PORT

And create the administrator account.

#> sentry --config=/etc/sentry.conf.py createsuperuser

Let's run the Sentry app!

#> sentry --config=/etc/sentry.conf.py start

Open your browser and configure your first project. Once done, you will be redirected to a sample page where you will find your public and secret key to connect to new project.

Sample application

captureMessage('hello world!');

// record exception
try {
    throw new Exception('Uh oh!');
}
catch (Exception $e) {
    $client->captureException($e);
}

$error_handler = new Raven_ErrorHandler($client);

// Register error handler callbacks
set_error_handler(array($error_handler, 'handleError'));
set_exception_handler(array($error_handler, 'handleException'));

Get the Raven-php library on github at https://github.com/getsentry/raven-php

Resources

Sentry quick start page
Sentry homepage

 


Share this article :

blog comments powered by Disqus

© 2012-2017 Ca va ENCORE parler de bits! All Rights Reserved.