Skip to content

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

License

Notifications You must be signed in to change notification settings

cloudsailor-team/raven-nette

This branch is up to date with marten-cz/raven-nette:master.

Repository files navigation

raven-nette

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

Tested with nette 2.3>, 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/raven-php
  context:
    user: true # Send logged in user information

List of all confuration options for getsentry/raven-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/raven-php
);

And that should be everything...

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%