Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure level based on environment variable (monolog integration) #384

Closed
FallDi opened this issue Oct 30, 2020 · 1 comment
Closed

Comments

@FallDi
Copy link

FallDi commented Oct 30, 2020

https://github.com/getsentry/sentry-symfony#optional-use-monolog-handler-provided-by-sentrysentry-available-since-320

Is it possible to configure level, based on environment variable?

sentry:
    register_error_listener: false # Disables the ErrorListener
    monolog:
        error_handler:
            enabled: true
#            level: error
             level: "%env(LOG_LEVEL)%"

Currently it fails with Incompatible use of dynamic environment variables "LOG_LEVEL" found in parameters.

Such availability will really useful.

Similar ability was implemented in Monolog bundle recently symfony/monolog-bundle@541e6e5

Following config will be perfect solve such issue

parameters:
    sentry.level: '%env(LOG_LEVEL)%'

sentry:
    dsn: "%env(SENTRY_DSN)%"
    options:
        environment: "%kernel.environment%"
    register_error_listener: false # Disables the ErrorListener
    monolog:
        error_handler:
            enabled: true
            level: "%sentry.level%"
@FallDi FallDi changed the title How to configure level based on environment variable How to configure level based on environment variable (monolog intergration) Oct 30, 2020
@FallDi FallDi changed the title How to configure level based on environment variable (monolog intergration) How to configure level based on environment variable (monolog integration) Oct 30, 2020
@Jean85
Copy link
Collaborator

Jean85 commented Jan 7, 2021

Closing this since we dropped the functionality in #406. Wrapping the whole Monolog config is too risky and fragile on our side, providing a good out-of-the-box handler should be enough for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants