Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

sentry/sentry-symfony 4.14.0

Symfony integration for Sentry (http://getsentry.com)
Package summary
Share
0
issues
0
licenses
Package created
29 Apr 2016
Version published
26 Feb 2024
Maintainers
4
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does sentry/sentry-symfony do?

The sentry/sentry-symfony package serves as the official Symfony SDK for Sentry. Sentry is a service focused on helping developers write better software faster by providing tools for error tracking and reporting. By integrating sentry/sentry-symfony into your Symfony app, you can quickly configure Sentry, include authenticated user data in each event automatically, as well as environment data specific to your Symfony project.

How do you use sentry/sentry-symfony?

To use sentry/sentry-symfony, you should first install it using Composer:

composer require sentry/sentry-symfony

If you encounter a message saying the package comes from the "contrib" repository, just type y to continue. If any errors occur related to Nyholm\Psr7\Factory\Psr17Factory::class, you can disable the PSR-7 bridge in your sensio framework extra configuration.

After installation, enable the bundle by adding it to the list of registered bundles in the Kernel.php file of your project:

class AppKernel extends \Symfony\Component\HttpKernel\Kernel
{
    public function registerBundles(): array
    {
        return [
            // ...
            new \Sentry\SentryBundle\SentryBundle(),
        ];
    }

    // ...
}

Then, add the Sentry DSN of your project to your app/config/config_prod.yml file for Symfony 3.4 or to your config/packages/sentry.yaml file for Symfony 4 and newer:

sentry:
    dsn: "https://public:secret@sentry.example.com/1"
    messenger:
        enabled: true # flushes Sentry messages at the end of each message handling
        capture_soft_fails: true # captures exceptions marked for retry too
    options:
        environment: '%kernel.environment%'
        release: '%env(VERSION)%' #your app version

Optionally, you can customize object serialization with class_serializers option or override default HTTP client/transport.

Where are the sentry/sentry-symfony docs?

The documentation for sentry/sentry-symfony can be found on the official Symfony SDK page of Sentry, which is accessible from here. You can also engage in discussions or ask questions about the SDK in the Sentry Community on Discord.