oxcom / symfony-rollbar-bundle Goto Github PK
View Code? Open in Web Editor NEWBundle for Symfony that integrates Rollbar tracker
License: MIT License
Bundle for Symfony that integrates Rollbar tracker
License: MIT License
Hi, guys. I saw, you added rollbar_js
configuration, but under this section you used CamelCase.
It's a bad practice use of writing compound words.
Could you please use snake case to write configuration for rollbar js
section as you used for rollbar
section?
On PHP 7+ (happened on 7.1.14), the bundle tries to serialize Closure
when it catches \Error
based throwable (f.e \TypeError
).
Error:
Error: Uncaught Exception: Serialization of 'Closure' is not allowed in vendor/oxcom/symfony-rollbar-bundle/EventListener/ExceptionListener.php:53
Hi,
For the person tracking, may I know the correct way to use it with the bundle?
I have tried defining the person_fn
to my service, but the getPerson()
method in my service never gets called unless I override the person
configuration definition (https://github.com/OxCom/symfony-rollbar-bundle/blob/master/DependencyInjection/Configuration.php#L141) with the following:
->scalarNode('person')->defaultNull()->end()
I try this because in rollbar-php https://github.com/rollbar/rollbar-php/blob/v1.6.3/src/DataBuilder.php#L868 it will skip the function call if person
is not null which it isn't in default bundle config (default value is []
). Trying to force it to null will still result in empty array value.
I'm using PHP7.2 btw.
Thanks
25x: A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.
4x in SymfonyRollbarExtensionTest::testConfigEnabledVars from SymfonyRollbarBundle\Tests\DependencyInjection
4x in SymfonyRollbarExtensionTest::testConfigDisabledVars from SymfonyRollbarBundle\Tests\DependencyInjection
4x in PersonProviderTest::testConstPerson from SymfonyRollbarBundle\Tests\Provider
2x in BundleTest::setUp from SymfonyRollbarBundle\Tests
2x in CheckIgnoreTest::testCheckIgnore from SymfonyRollbarBundle\Tests\Provider
2x in CheckIgnoreTest::testPersonProviderFunction from SymfonyRollbarBundle\Tests\Provider
2x in PersonProviderTest::testPersonProviderWasCalled from SymfonyRollbarBundle\Tests\Provider
2x in RollbarHandlerTest::testWriteDisabledRollbar from SymfonyRollbarBundle\Tests\Provider
2x in RollbarExtensionTest::testRollbarJs from SymfonyRollbarBundle\Tests\Twig
1x in ConfigurationTest::testEmptyConfiguration from SymfonyRollbarBundle\Tests\DependencyInjection
Rollbar allows Person tracking. Very useful in some cases (you can track previous errors of given user etc).
It's able to send data about logged user:
As the bundle uses Monolog, this StackOverflow answer should help a bit.
Of course, we should be able to configure which data we'd like to send to Rollbar.
Hello, guys. I have a question about person_fn
config parameter. Why is it null by default?
Why don't you define a class like this by default:
class PersonProvider implements InterfacePersonProvider
{
/** @var TokenStorageInterface */
private $tokenStorage;
public function __construct(TokenStorageInterface $tokenStorage)
{
$this->tokenStorage = $tokenStorage;
}
public function getPerson(): array
{
if ($token = $this->tokenStorage->getToken()) {
$user = $token->getUser();
if (!$user || !is_object($user)) {
return [];
}
$userData = [];
if (method_exists($user, 'getId')) {
$userData['id'] = $user->getId();
} else {
// id is required
$userData['id'] = $user->getUsername();
}
$userData['username'] = $user->getUsername();
if (method_exists($user, 'getEmail')) {
$userData['email'] = $user->getEmail();
}
return $userData;
}
return [];
}
}
So, it would be convenient for a lot of users, because they don't need to create own service to get user data. It's better than nothing, isn't it?
And of course they can override it, if they would need some additional data.
Hi,
Trying to install the bundle but getting the following error :
There is no extension able to load the configuration for "symfony_rollbar"
I have the bundle registered in config/bundles.php
Any idea why I'm getting this error ?
Thanks in advance,
Julien
Provide integration for RollbarJS
Hello. I found some unexpected behaviour in your bundle. Could you please tell me why you placed \Symfony\Component\Debug\Exception\FatalErrorException
to exclude
section in config?
Simplified example.
$array = [];
// developer thinks that $array it is ArrayCollection
$array->first(); // For php 7 \Error will be thrown here
We use symfony v3.4.15
To process the error, Symfony\Component\Debug\ErrorHandler::handleException
will be called, which converts Error
to FatalThrowableError
which extends FatalErrorException
Look here on code: https://github.com/symfony/debug/blob/master/ErrorHandler.php#L520
As result, error will be not reported because of exclude
default values in config.
If you want to show how to use exclude option, I suggest to create ExampleException class in SymfonyRollbarBundle which won't used anywhere and put this exception to exclude
section.
What do you think about it?
Hi, guys! All exceptions which happen in console command don't catch by bundle.
So, we don't have notifications about these errors in Rollbar.
Could you please add console.error and console.exception listeners?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.