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

[FEATURE] Allow disabling sentry integration via config #87

Closed
wants to merge 1 commit into from

Conversation

baschny
Copy link

@baschny baschny commented Aug 9, 2023

Allow switching it off via extension configuration (disableSentry) or environment variable (SENTRY_DISABLE). Default is backwards compatible (enabled).

Either set the environment variable:

SENTRY_DISABLE=1

Or set it in TYPO3 based on some condition, for example in your AdditionalConfiguration.php
aka config/system/additional.php:

if (\TYPO3\CMS\Core\Core\Environment::getContext()->isDevelopment()) {
    $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['sentry_client']['disableSentry'] = true;
}

Resolves #85

Use-case could be a staging or dev environment.
Switchable via extension configuration (`disableSentry`) or
environment variable (`SENTRY_DISABLE`).
@baschny baschny changed the title Allow disabling sentry integration via config [FEATURE] Allow disabling sentry integration via config Aug 9, 2023
@christophlehmann
Copy link
Contributor

At first, thanks for the PR, but do we really need it?

Currently an empty dsn with $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['sentry_client']['dsn'] or an empty env variable SENTRY_DSN="" should deactivate the Sentry client.

Doesn't it work ? See https://github.com/networkteam/sentry_client/blob/master/Classes/Client.php#L40

@baschny
Copy link
Author

baschny commented Aug 10, 2023

It deactivates the client, but it does not deactivate the integration, meaning that ProductionExceptionHandler and also the Logwriter configuration is still going to Sentry (instead of a File).

@baschny
Copy link
Author

baschny commented Aug 10, 2023

I would be ok that if the "dsn" is not set, the integration (i.e. the hooks registration in ext_localconf.php) does not kick in by default, my change was meant to be as backwards compatible as possible.

@christophlehmann
Copy link
Contributor

Context based configuration is now possible with v5.0.0. Please create a new issue given something is still wrong

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

Successfully merging this pull request may close these issues.

Make configurable on TYPO3 context
2 participants