GithubHelp home page GithubHelp logo

salamek / raven-nette Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 5.0 28 KB

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

License: BSD 3-Clause "New" or "Revised" License

PHP 100.00%
nette tracy raven-nette sentry-php

raven-nette's Introduction

Project abandoned due to incompatibility with nette 2.4

Please use kdyby/monolog instead

Simple migration guide

  1. Remove all configuration related to salamek/raven-nette && composer depedency from composer.json
  2. Install kdyby/monolog and sentry/sentry
composer require kdyby/monolog
composer require sentry/sentry
  1. 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
  1. Profit... For more informations consult kdyby/monolog documentation

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...

raven-nette's People

Contributors

jirimachacek avatar marten-cz avatar salamek avatar spisovatelprogramu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

raven-nette's Issues

Coding style

Hi, I would like to clean the files and choose one coding style for them.

  • do you want to use tabs or spaces?
  • do you want to write constants in upper case or lower case (TRUE vs true)
  • how many empty lines between methods and after class start and before class end?

I have some functional changes but I would like to solve this first. What about using PSR?

Does not work in production mode

It does not log errors in production mode. For example if i throw new \Exception() in component render() method, Sentry is empty but log directory contain the exception.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.