networkteam / sentry_client

TYPO3 Extension for exception logging with sentry, see http://www.getsentry.com
33 stars 35 forks source link

Best way to disable on local development systems? #78

Closed cweiske closed 1 year ago

cweiske commented 1 year ago

We use sentry_client to capture errors in our TYPO3 installations on testing, staging and production environments. On local development environments we disable sentry_client, because those errors are handled by the developer instantly.

We disable sentry_client by adding some code to AdditionalConfiguration.php:

$env = (string) \TYPO3\CMS\Core\Core\Environment::getContext();
if ($env === 'Development/Local') {
    $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['sentry_client']['dsn'] = '';
}

This works but has one problem: When someone installs an extension or modifies extension configuration in the TYPO3 backend, the empty DSN is written into LocalConfiguration.php. When committing changes, people need to take care to not commit that line.

Is there a better way to disable sentry_client locally?

christophlehmann commented 1 year ago

How about using dot env?