Releases: getsentry/sentry-php
Releases · getsentry/sentry-php
4.18.1
4.18.0
The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.18.0.
Features
- Add support for feature flags. (#1951)
\Sentry\SentrySdk::getCurrentHub()->configureScope(function (\Sentry\State\Scope $scope) {
$scope->addFeatureFlag("my.feature.enabled", true);
});- Add more representations for log attributes instead of dropping them. (#1950)
Misc
- Merge log attributes in a separate method. (#1931)
4.17.1
4.17.0
The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.17.0.
Bug Fixes
- Empty strings will no longer display
<encoding error>when serialized. (#1940)
Misc
4.16.0
The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.16.0.
Features
- Remove
max_breadcrumbslimit. (#1890) - Implement
__destructinLogsHandlerto make sure logs are always flushed. (#1916)
Bug Fixes
- Use PSR log level when logging messages using the PSR-3 logger within the SDK. (#1907)
- Remove
@internalannotation fromSentry\Transport\Result. (#1904)
Misc
- Add
sentry.originattribute toLogsHandler. (#1917)
4.15.2
4.15.1
4.15.0
The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.15.0.
Features
-
Add Monolog Sentry Logs handler (#1867)
This new handler allows you to capture Monolog logs as Sentry logs. To use it, configure your Monolog logger:
use Monolog\Logger; use Sentry\Monolog\LogsHandler; use Sentry\Logs\LogLevel; // Initialize Sentry SDK first (make sure 'enable_logs' is set to true) \Sentry\init([ 'dsn' => '__YOUR_DSN__', 'enable_logs' => true, ]); // Create a Monolog logger $logger = new Logger('my-app'); // Add the Sentry logs handler // Optional: specify minimum log level (defaults to LogLevel::debug()) $handler = new LogsHandler(LogLevel::info()); $logger->pushHandler($handler); // Now your logs will be sent to Sentry $logger->info('User logged in', ['user_id' => 123]); $logger->error('Payment failed', ['order_id' => 456]);
Note: The handler will not collect logs for exceptions (they should be handled separately via
captureException).