Giter Site home page Giter Site logo

yii2-rollbar's People

Contributors

baibaratsky avatar code418 avatar crystinutzaa avatar djagya avatar friek108 avatar gelige avatar lgelfan avatar niektenhoopen avatar rokob avatar skjb avatar yumgame avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

yii2-rollbar's Issues

Yii2 Custom Error Handler - Errors should not be displayed in browser

I need to create a custom error handler by extending rollbar error handler that should always handle fatal errors, but handle notice errors only if we are in debug mode. In production mode, all notice errors should not be displayed in the browser instead it should be logged in rollbar and get notified. Can anyone suggest an idea on how to go with this error handling?

I just started by extending Yii2 base error handler,

<?php
namespace common\components;
class ErrorHandler extends \yii\web\ErrorHandler
{
    public function register()
    {
        ini_set('display_errors', false);
        set_exception_handler([$this, 'handleException']);
        register_shutdown_function([$this, 'handleFatalError']);
    }
}

With this above code, I'm able to hide notice error from the browser and get logged in php error log. Now the thing is I need to get log in rollbar and get notified as usual.

PHP8 support

Hi guys,
Is it possible to set rollbar/rollbar v3.* in composer for supporting php 8?

Dependency Compatibility Issue

Just updated to newest version (v1.6.1) but the the line
rollbar/rollbar": "^1.3.3,
causes the Rollbar dependency to update to v1.4.0 which creates errors in the application.
The new Rollbar version seems to be asking for a new constant called IS_UNCAUGHT_KEY

Rolling back to v1.6.0 seems to be a temporary solution for now.

Rolling back to
capture

Ignore Exceptions is NOT working

I used this plugin in my Yii2 project. Ignore exception configuration is not working. This is my configuration

'rollbar' => [
            'class' => 'baibaratsky\yii\rollbar\Rollbar',
            'accessToken' => env('ROLLBAR_POST_SERVER_ITEM'),
            'environment' => env('ROLLBAR_ENVIRONMENT'),
            'ignoreExceptions' => [
                ['yii\web\HttpException', 'statusCode' => [400, 404]],
                ['yii\web\HttpException', 'statusCode' => [403], 'message' => ['This action is forbidden']],
        ], 

Screenshot of rollbar account page
image

Can anyone please help me to ignore 404, 403 errors and bot request?

Exception 'Exception' with message 'Level '' doesn't exist.'

2018-05-07 21:41:27 [197.251.181.44][-][-][warning][yii\log\Dispatcher::dispatch] Unable to send log 
via baibaratsky\yii\rollbar\log\Target: Exception 'Exception' with message 'Level '' doesn't exist.' 

in /home/yii2/vendor/rollbar/rollbar/src/Payload/Level.php:42

Stack trace:
#0 /home/yii2/vendor/baibaratsky/yii2-rollbar/log/Target.php(22): 
Rollbar\Payload\Level::__callStatic('fromName', Array)
#1 /home/yii2/vendor/yiisoft/yii2/log/Target.php(133): 
  baibaratsky\yii\rollbar\log\Target->export()
#2 /home/yii2/vendor/yiisoft/yii2/log/Dispatcher.php(189): yii\log\Target->collect(Array, true)
#3 /home/yii2/vendor/yiisoft/yii2/log/Logger.php(177): yii\log\Dispatcher->dispatch(Array, true)
#4 [internal function]: yii\log\Logger->flush(true)
#5 {main}

in my controller i called
\Yii::info($message);

Support for Rollbar 1.x?

Trying to update Rollbar from 0.18.x to 1.x and I get:

baibaratsky/yii2-rollbar v1.5.0 requires rollbar/rollbar ~0.18.0 -> satisfiable by rollbar/rollbar[v0.18.0, v0.18.2] but these conflict with your requirements or minimum-stability.

Are there plans to support Rollbar 1.x?

Thanks.

Compatibility problem in php 7

If an application throws ParseError then this extension makes fatal error:

Uncaught TypeError: Argument 1 passed to baibaratsky\yii\rollbar\web\ErrorHandler::getPayloadData() must be an instance of Exception, instance of ParseError given, called in /var/www/app/vendor/baibaratsky/yii2-rollbar/ErrorHandlerTrait.php on line 44 and defined in /var/www/app/vendor/baibaratsky/yii2-rollbar/ErrorHandlerTrait.php:64

API error: Invalid format. data.body must not be undefined.

Hello.
API error: Invalid format. data.body must not be undefined. Instead, it should be an object with a 'message', 'trace', 'trace_chain', or 'crash_report' key.

tried different versions:
baibaratsky/yii2-rollbar:1.4.* (rollbar-php:0.18.2)
baibaratsky/yii2-rollbar:1.1.0 (rollbar-php:0.15.0)

Callback for ignoring exceptions

IgnoreExceptions is great, gives great control... however for API rollbar tracking, an invalid response will be returned as json like the below:

{"name":"Unauthorized","message":"Your request was made with invalid credentials.","code":0,"status":401}

Would it be possible to add in maybe a callback to determine if a request should be sent to rollbar?

Protected exception property

When message property is defined in ignoreExceptions method \baibaratsky\yii\rollbar\ErrorHandlerTrait::logException throws Cannot access protected property yii\web\BadRequestHttpException::$message
'ignoreExceptions' => [ ['\Exception', 'message' => ['{"statusCode":400}']], ],

init error

if setup as in documentation i got an error

InvalidArgumentException: $config['environment'] must not be null

so need add something like
'environment' => 'production'
to configuration init

Log level 'info'

In my config:

'rollbar' => [
                    'class' => 'baibaratsky\yii\rollbar\log\Target',
                    'levels' => ['error', 'warning'], // Log levels not contain "info" (!)
                ],

But in Rollbar I have INFO notification like #54 $_COOKIE = [
How to remove their from?

Your requirements could not be resolved to an installable set of packages.

Hi

Trying to install but due to conflicts I'm not having any luck - think it's rollbar/rollbar v1.3.1 that's the issue as it requires on the older version of psr/log:1.0.2

technically rollbar/rollbar v1.3.4 should work, as this includes a psr/log ^1.0.2

composer require baibaratsky/yii2-rollbar:1.7.*
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - baibaratsky/yii2-rollbar v1.7.0 requires rollbar/rollbar 1.3.1 -> satisfiable by rollbar/rollbar[v1.3.1].
    - baibaratsky/yii2-rollbar v1.7.1 requires rollbar/rollbar 1.3.1 -> satisfiable by rollbar/rollbar[v1.3.1].
    - rollbar/rollbar v1.3.1 requires psr/log ~1.0.2 -> satisfiable by psr/log[1.0.2] but these conflict with your requirements or minimum-stability.
    - Installation request for baibaratsky/yii2-rollbar 1.7.* -> satisfiable by baibaratsky/yii2-rollbar[v1.7.0, v1.7.1].
Installation failed, reverting ./composer.json to its original content.

Any chance we can get this updated, tested to work with psr/log:1.1.* & craftcms/cms:^3.0.0
Thanks in advance.

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.