networkteam / sentry_client

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

Make configurable on TYPO3 context #85

Closed Zillion01 closed 10 months ago

Zillion01 commented 1 year ago

It seems it's not possible to set the logging and debug handling based on context?

When I put in AdditionalConfiguration.php for the isDevelopment context an override like

$GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration'] = [ \TYPO3\CMS\Core\Log\LogLevel::ERROR => [ \TYPO3\CMS\Core\Log\Writer\FileWriter::class => [], ], ];

This just gets ignored and still everything is send to Sentry. Easy fix, make an option to set it globally (like now in ext_localconf.php) or set it manually yourself.

Client::captureException(new \Exception($exceptionMessage)); should then still work but send stuf to TYPO3 log / debughandler

baschny commented 11 months ago

I also needed this functionality, see my implementation https://github.com/networkteam/sentry_client/pull/87 - feel free to merge, if you find it useful, dear maintainers.

christophlehmann commented 10 months ago

Hey, context based configuration should work now with main branch. Please re-open if something is still wrong