Statistics
20465
5
0
275d
Badges
Tags
tracy
Dependencies

raven-nette

Donate

This is nette implementation of sentry raven-php as logger service for tracy.

Tested with nette 2.2>, please report any bugs into Issues

PR's are welcomed!

Installation and usage

Installation via composer:

composer require salamek/raven-nette

Usage

Register extension to your config.neon:

extensions:
  sentryLogger: Salamek\RavenNette\DI\SentryLoggerExtension

And configure by setting:

sentryLogger:
  dsn: 'YOUR_SENTRY_DSN'

  # Optional configuration values
  inDebug: false # bool: Log in debug mode ? default is false
  directory: null # string|null: Where to store log files ? default is Debugger::$logDirectory, null to disable
  email: null # string|null :Where to send email notifications ? default is Debugger::$email, null to disable
  options: [release: YOUR_RELEASE] # array :All options supported by getsentry/sentry-php
  context:
    user: true # Send logged in user information

List of all confuration options for getsentry/sentry-php

Alternative Usage

If you dont want to use DI, and/or be able to log errors as soon as posible use this approach

Put this code into your app/bootstrap.php after RobotLoader is initiated and $configurator->enableDebugger is called:

// Initiate sentryLogger
new \Salamek\RavenNette\SentryLogger(
  'YOUR_SENTRY_DSN', //Sentry DSN
  false, //Log in DEBUG mode ? //You dont want that...
  null, //Set where do you want to store file log (Tracy\Debugger::$logDirectory | null | string)
  null, //Send email as usual logger ?   (Tracy\Debugger::$email | null | string | array )
  true,
  ['release' => 'YOUR_RELEASE'] //All options supported by getsentry/sentry-php
);

Usage only with tracy

If you dont want use nette at all but only raven-nette and tracy... well you can!

include('vendor/autoload.php');
use Tracy\Debugger;

Debugger::enable(Debugger::PRODUCTION);

new \Salamek\RavenNette\SentryLogger(
  'YOUR_SENTRY_DSN', //Sentry DSN
  false, //Log in DEBUG mode ? //You dont want that...
  null, //Set where do you want to store file log (Tracy\Debugger::$logDirectory | null | string)
  null, //Send email as usual logger ?   (Tracy\Debugger::$email | null | string | array )
  true,
  ['release' => 'YOUR_RELEASE'] //All options supported by getsentry/sentry-php
);

Debugger::log('My error', 'error');

And that should be everything...

  • v1.3.3

  • v1.3.2

  • v1.3.1 Release of v1.3.1

    • Switch from deprecated raven/raven to sentry/sentry
  • v1.3.0 Release of v1.3.0

    • Codestyle cleanup
    • Option to send logged in user information to sentry when enabled in config marten-cz
    • Added support for configuration options xdobro4
  • v1.1.1 Fixing release

  • v1.1 First release

  • v1.0-alpha First alpha release

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette admin@componette.com