networkteam / sentry_client

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

Missing initialization of SentryService in SentryLogWriter #96

Closed codemonkey1988 closed 6 months ago

codemonkey1988 commented 9 months ago

The SentryLogWriter by now only works in combination with one of the ExceptionHandler-Classes. The SentryService gets only initialized in the ExceptionHandler-Classes. Using the Logging-Framework without an exception, the data will not be send to sentry, because to SentryService::isEnabled() check always returns false because of the missing SentryService::initialize() call.

Tested with TYPO3 12.4 sentry_client: 5.0.1

BugHunter2k commented 8 months ago

I stumbled across this today. May be a simple check in the SentryService class, before returning isEnabled is enough to let this work?

        is_null(self::$isEnabled) && self::inititalize();
websi commented 6 months ago

The same is for the class \Networkteam\SentryClient\Content\ProductionExceptionHandler and the Toolbar Information.

websi commented 6 months ago

ok, if you configure both exception handler (Production and DebugException), Sentry is always initialized. The Method \TYPO3\CMS\Core\Core\Bootstrap::initializeErrorHandling is called, before loading ext_localconf.php

Maybe extend the documentation for these behaviour.