The Sentry PHP error reporter tracks errors and exceptions that happen during the execution of your application and provides instant notification with detailed informations needed to prioritize, identify, reproduce and fix each issue. Learn more about automatic PHP error reporting with Sentry.
- Automatically report (un)handled exceptions and errors
- Send customized diagnostic data
- Process and sanitize data before sending it over the network
To install the SDK you will need to be using Composer in your project. To install it please see the docs.
Sentry PHP is not tied to any specific library that sends HTTP messages. Instead, it uses Httplug to let users choose whichever PSR-7 implementation and HTTP client they want to use.
If you just want to get started quickly you should run the following command:
php composer.phar require sentry/sentry php-http/curl-client guzzlehttp/psr7
This will install the library itself along with an HTTP client adapter that uses
cURL as transport method (provided by Httplug) and a PSR-7 implementation
(provided by Guzzle). You do not have to use those packages if you do not want to.
The SDK does not care about which transport method you want to use because it's
an implementation detail of your application. You may use any package that provides
php-http/async-client-implementation
and http-message-implementation
.
namespace XXX;
use Raven\ClientBuilder;
require 'vendor/autoload.php';
// Instantiate the SDK with your DSN
$client = ClientBuilder::create(['server' => 'http://public:[email protected]/1'])->getClient();
// Capture an exception
$eventId = $client->captureException(new \RuntimeException('Hello World!'));
// Give the user feedback
echo 'Sorry, there was an error!';
echo 'Your reference ID is ' . $eventId;
For more information, see our documentation.
Other packages exists to integrate this SDK into the most common frameworks.
- Documentation
- Bug Tracker
- Code
- Mailing List
- IRC (irc.freenode.net, #sentry)
Dependencies are managed through composer:
$ composer install
Tests can then be run via phpunit:
$ vendor/bin/phpunit