Connect TYPO3 to Bugsink

When a TYPO3 request or background task fails, Bugsink can show you the error, the application frame that reported it, and the TYPO3 context in which it ran.

This guide installs the networkteam/sentry-client extension, configures its exception and logging paths, and triggers a deliberate command failure. The extension uses the open-source Sentry PHP SDK and sends its events directly to your Bugsink project.

To follow along, create a Bugsink project and copy its DSN. The quickstart guide shows where to find it.

Install the extension

Add the maintained TYPO3 extension with Composer:

composer require networkteam/sentry-client

Version 6 of the extension supports TYPO3 12, 13, and 14. Composer selects a compatible version for the TYPO3 packages already in your application.

Configure TYPO3

Create config/system/additional.php and register both exception handlers and the log writer:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['productionExceptionHandler'] = ProductionExceptionHandler::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['debugExceptionHandler'] = DebugExceptionHandler::class;
$GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration'][LogLevel::ERROR][SentryLogWriter::class] = [];

The exception handlers report failures which escape a frontend or backend request. The writer also forwards TYPO3 records at ERROR and above, which is important for scheduler tasks and commands that catch an exception and log it.

Configure your DSN

Give every PHP process that runs TYPO3 the DSN from your Bugsink project:

export SENTRY_DSN=https://key@bugsink.example/1
export SENTRY_RELEASE=inventory-typo3@1.0.0
export SENTRY_ENVIRONMENT=production

The release should identify the code you deployed, and the environment keeps production and staging errors distinguishable. Web workers, command-line jobs, and the TYPO3 scheduler must all inherit these variables.

Trigger a logged failure

TYPO3 often catches a task failure so it can finish bookkeeping or return a useful exit status. This inventory command follows that pattern and logs the original exception through the logger TYPO3 injects:

try {
            $this->loadProduct('typo3-missing');
        } catch (RuntimeException $exception) {
            $this->logger->error(
                'Inventory synchronization failed for {sku}: {message}',
                [
                    'sku' => 'typo3-missing',
                    'message' => $exception->getMessage(),
                    'exception' => $exception,
                ],
            );
            $output->writeln('<error>Inventory synchronization failed.</error>');
            return Command::FAILURE;
        }

Run the command after exporting your Bugsink settings:

vendor/bin/typo3 inventory:sync

The command prints its error and exits with status 1. The log writer sends the interpolated message, the application logger frame, and the CLI context before the process exits.

See the error in Bugsink

Open your Bugsink project and select the new inventory synchronization issue. Its stack ends at the application logger call, and its event details identify the request type as cli.

Bugsink preview

That’s it: TYPO3 exceptions and error-level log records will now be reported to Bugsink.

Exception handlers and logs

Unhandled frontend and backend exceptions go through the two configured exception handlers. Those events retain the exception type and exception stack, so they normally point directly at the line which failed.

The log writer sends a message event for a record TYPO3 has already handled. Its stack points to the logger call rather than the original throw; this integration keeps the caught exception as structured log data instead.

The extension deliberately ignores some TYPO3 components to prevent reporting loops and does not report database-connection failures by default. Those are extension choices, not restrictions in Bugsink’s event ingestion.

For explicit exception capture, messages, and other PHP SDK options, continue with the PHP guide.