- How do I install tekoway/symfony-rollbar in a Symfony application?
- Install it with Composer using composer require tekoway/symfony-rollbar. Then register the bundle in config/bundles.php for the environments where you want reporting enabled. Finally, add your Rollbar access token and environment name to a YAML file such as config/packages/tekoway_rollbar.yaml and clear the cache.
- Does tekoway/symfony-rollbar work with Laravel?
- No. This package is a Symfony integration that hooks into Symfony's service container and kernel exception event, so it is not a drop-in solution for Laravel. For Laravel you should use a Laravel-specific Rollbar package or the official Rollbar PHP SDK wired through a custom service provider.
- How do I configure the Rollbar access token for different Symfony environments?
- The bundle reads its access token and environment name from YAML configuration, so you can set different values per Symfony environment. A common approach is to store the token in .env as ROLLBAR_TOKEN and reference it from the config file with '%env(ROLLBAR_TOKEN)%'. The environment value tells Rollbar which deployment an error came from, so use something like prod, staging, or dev.
- Which Symfony versions does tekoway/symfony-rollbar support?
- The bundle relies on standard Symfony bundle, dependency injection, and event dispatcher features that are stable across recent Symfony releases. Check the composer.json constraints in the repository for the exact supported version range before installing. If you are on an older Symfony version, verify that the bundle registration and configuration syntax match your framework version.
- How does automatic exception reporting work with this bundle?
- The bundle registers a listener on Symfony's kernel exception event, so uncaught exceptions thrown during a request are forwarded to Rollbar automatically. That means you do not need to wrap controllers or services in try/catch blocks just to report errors. Rollbar then groups similar errors and can alert you when new ones appear in production.
- Can I inject the Rollbar notifier into my own Symfony services?
- Yes. The bundle wires Rollbar into Symfony's service container, so you can type-hint the notifier service in your constructor and let autowiring handle the rest. This is useful when you want to report handled exceptions or send custom messages with extra context. Check the bundle's configuration reference for the exact service ID or interface to use.
- How do I stop Rollbar from reporting errors in dev and test environments?
- Enable the bundle only for the environments you care about, or give dev and test their own token and environment values so their noise stays separate. Many teams disable the bundle entirely in the test environment to keep test runs fast and deterministic. Pointing dev at a separate Rollbar project is another way to keep local errors out of production alerts.
- Does tekoway/symfony-rollbar capture logged errors as well as exceptions?
- Exceptions are captured automatically through the kernel exception event, and logged errors can be forwarded to Rollbar as well when the bundle is hooked into Symfony's logging stack. It does not replace Monolog: your normal handlers keep writing to files, stderr, or other destinations, and Rollbar becomes an additional tracking and alerting layer. That lets you keep detailed local logs while using Rollbar for production visibility.
- How can I test that exceptions are actually reaching Rollbar?
- Trigger a deliberate exception in a staging environment where the bundle is enabled with a real token, then check the Rollbar dashboard for the new item. If nothing shows up, confirm the bundle is registered for that environment and that the token and environment config are loaded. Also clear the Symfony cache after config changes and make sure the kernel exception listener has not been disabled.
- What are the alternatives to tekoway/symfony-rollbar?
- You can use the official rollbar/rollbar-php SDK directly and wire it into a small Symfony service yourself, or use a Monolog handler that ships events to Rollbar. Sentry's Symfony SDK is a common alternative if you are open to a different error tracking provider. This bundle is mainly a convenience wrapper, so the choice comes down to whether you want the container and event integration handled for you.