SDK
PHP SDK
Description
Page: https://docs.sentry.io/platforms/php/logs/
SDK version: sentry/sentry 4.30
Problem
The PHP Logs docs show constructing the Monolog logs handler with a Hub (and level) argument
$handler = new \Sentry\Monolog\LogsHandler($hub, Level::Info);
This signature does not exist in sentry/sentry 4.30. LogsHandler does not accept a Hub in its constructor, so following the docs as written fails.
What works instead (4.30)
$log->pushHandler(new \Sentry\Monolog\LogsHandler(Level::Info));
The handler uses the current hub from the initialized SDK; no Hub argument is needed.
Request
Please update the Logs page to match the 4.x LogsHandler signature, or clarify which SDK version the current example targets.
Suggested Solution
$log->pushHandler(new \Sentry\Monolog\LogsHandler(Level::Info));
SDK
PHP SDK
Description
Page: https://docs.sentry.io/platforms/php/logs/
SDK version: sentry/sentry 4.30
Problem
The PHP Logs docs show constructing the Monolog logs handler with a Hub (and level) argument
$handler = new \Sentry\Monolog\LogsHandler($hub, Level::Info);This signature does not exist in sentry/sentry 4.30. LogsHandler does not accept a Hub in its constructor, so following the docs as written fails.
What works instead (4.30)
$log->pushHandler(new \Sentry\Monolog\LogsHandler(Level::Info));The handler uses the current hub from the initialized SDK; no Hub argument is needed.
Request
Please update the Logs page to match the 4.x LogsHandler signature, or clarify which SDK version the current example targets.
Suggested Solution
$log->pushHandler(new \Sentry\Monolog\LogsHandler(Level::Info));