[PHP] Sentry 2.1 with monolog

Hello,

I’m trying to replace old Raven library with a very old Sentry Infra (version 7.x)
So, i install sentry/sdk (sentry/sentry:2.1) and integrate it with monolog on a Sentry version 9.x

I have something like this

\Sentry\init([
	// Lib Config
	'dsn' => $errorReportingSentryDSN,
	'default_integrations' => false,
	'attach_stacktrace' => true,
	//'error_types' => E_ALL & ~E_WARNING & ~E_DEPRECATED & ~E_NOTICE & ~E_USER_DEPRECATED,
	// Set the app version
	'release' => $version,
	// Set the environment 
	'environment' => $sentryEnv, // Set PROD, POSTPROD, PREPROD, TEST, LOCAL
]);
// User
\Sentry\configureScope(function (\Sentry\State\Scope $scope): void {
	$data = [];
	// Specific vars indexes in sentry search engine
	// ....
	$scope->setUser($data);            
});
			 
$hub = \Sentry\State\Hub::getCurrent();
$sentryHandler = new \Sentry\Monolog\Handler($hub, \Psr\Log\LogLevel::INFO, true);
$logger->pushHandler($sentryHandler);

\Monolog\Registry::addLogger($logger);   
// --- Register error handler
\Monolog\ErrorHandler::register($logger, [], false);

I set default_integrations to false in order to let Monolog manage error (Fatal error), but i can’t reproduce my old display

Before i got only one log with url as title, message, exception and stacktrace

And now i got message as title, no transaction (which must be url), and no stacktrace.

  • perhaps because i only use fatal error handler, exception handler stop the process when the error occured so i disable it

And if i set default_integrations to true, i have two log at the same time
one with message as title, url in transaction, no stacktrace
second with stacktrace and always as below
sentry01
I have the same result if i use it without monolog

i have no idea to use it simply and have the maximum information in the log