Skip to content

I configured sentry-symfony according to the docs, but nothing is logged #523

@lmeyer1

Description

@lmeyer1

Environment

I'm using Sentry SaaS (sentry.io).

Which SDK and version? In composer:

"sentry/sentry-symfony": "^3.5",
"symfony/symfony": "^3.4.37",
/* required because sentry/sentry-symfony installs symfony/polyfill-php80, 
but Prestashop is not compatible yet with PHP 8.0, nor with the polyfill >1.18 */
"symfony/polyfill-php80": "<=1.18",

Currently installed:

  • symfony/monolog-bundle: 3.5.0
  • sentry-symfony: 3.5.4
  • symfony: 3.4.37

The application is Prestashop 1.7.7.4 https://github.com/PrestaShop/PrestaShop

Steps to Reproduce

According to the docs, I modified config_dev.yml

monolog:
    handlers:
        main:
            type:   stream
            path:   '%env(PS_LOG_OUTPUT)%'
            level:  debug
            channels: ["!event"]
        sentry:
            type: service
            id: Sentry\Monolog\Handler
        console:
            type:   console
            bubble: false
            verbosity_levels:
                VERBOSITY_VERBOSE: INFO
                VERBOSITY_VERY_VERBOSE: DEBUG
            channels: ["!doctrine"]
        console_very_verbose:
            type:   console
            bubble: false
            verbosity_levels:
                VERBOSITY_VERBOSE: NOTICE
                VERBOSITY_VERY_VERBOSE: NOTICE
                VERBOSITY_DEBUG: DEBUG
            channels: ["doctrine"]

sentry:
    dsn: "https://f3***9c@o4***8.ingest.sentry.io/5***0"

services:
    Sentry\Monolog\Handler:
        arguments:
            $hub: '@Sentry\State\HubInterface'
            $level: !php/const Monolog\Logger::ERROR

There is no file like bundles.php as mentionned in the docs. Instead I added

$bundles[] = new Sentry\SentryBundle\SentryBundle();

to app/AppKernel.php.

Expected Result

I expect an exception to be sent to sentry.io

throw new Exception('Test Sentry');

Actual Result

Nothing is sent to sentry.io. The configuration of the application looks OK:

$ php bin/console debug:config sentry

Current configuration for extension with alias "sentry"
=======================================================

sentry:
    dsn: 'https://f3***9c@o4***8.ingest.sentry.io/5***0'
    register_error_listener: true
    (...)
    monolog:
        error_handler:
            enabled: false
            level: DEBUG
            bubble: true
    messenger:
        enabled: false
        capture_soft_fails: true

$ php bin/console debug:config monolog

Current configuration for extension with alias "monolog"
========================================================

monolog:
    handlers:
        main:
            type: stream
            path: '%env(PS_LOG_OUTPUT)%'
            level: debug
            channels:
                type: exclusive
                elements:
                    - event
            priority: 0
            bubble: true
(...)
        sentry:
            type: service
            id: Sentry\Monolog\Handler
            priority: 0
            level: DEBUG
            bubble: true
(...)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions