Page MenuHomeDevCentral

Integrate with Sentry
Closed, ResolvedPublic

Description

Goal

We want to consolidate error reporting from Nasqueron applications.

Plan

Plan is to:

  • add Raven as dep
  • require a sentry DSN in the configuration
  • if provided, add a Raven handler to the logging component

Code sample

The following snippet code is offered by the Sentry dashboard (I'm adding the use ($dsn)):

$dsn = ;
$app->configureMonologUsing(function($monolog) use ($dsn) {
    $client = new Raven_Client($dsn);

    $handler = new Monolog\Handler\RavenHandler($client);
    $handler->setFormatter(new Monolog\Formatter\LineFormatter("%message% %context% %extra%\n"));

    $monolog->pushHandler($handler);
});

Revisions and Commits

Event Timeline

This plan allows to copy textual log to Raven. Exceptions are pure text, where Raven handles stacktraces, with source code snippets for context.

New plan to directly use the Raven client to send exception is:

  1. Provide a SentryServiceprovider, with a Raven facade
  2. Call Raven::captureException from the exception handler