salamek / raven-nette
Nette implementation of sentry raven-php as logger service for tracy.
Installs: 57 821
Dependents: 1
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 6
Open Issues: 0
Requires
- php: >=5.3.0
- sentry/sentry: >=0.11.0
- tracy/tracy: >=2.1.0
This package is not auto-updated.
Last update: 2022-02-01 12:47:33 UTC
README
Please use kdyby/monolog
instead
Simple migration guide
- Remove all configuration related to
salamek/raven-nette
&& composer depedency fromcomposer.json
- Install
kdyby/monolog
andsentry/sentry
composer require kdyby/monolog composer require sentry/sentry
- Configure new extension
sentry: dsn: 'YOUR_SENTRY_DSN' extensions: monolog: Kdyby\Monolog\DI\MonologExtension monolog: name: PROJECT_NAME hookToTracy: true registerFallback: true handlers: raven: Monolog\Handler\RavenHandler(Raven_Client(%sentry.dsn%)) processors: - Monolog\Processor\GitProcessor - Monolog\Processor\WebProcessor - Kdyby\Monolog\Processor\PriorityProcessor
- Profit...
For more informations consult
kdyby/monolog
documentation
raven-nette
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...