Releases: getsentry/sentry-php
4.16.0
The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.16.0.
Features
- Remove
max_breadcrumbs
limit. (#1890) - Implement
__destruct
inLogsHandler
to 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
@internal
annotation fromSentry\Transport\Result
. (#1904)
Misc
- Add
sentry.origin
attribute 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
).
Bug Fixes
4.14.2
4.14.1
4.14.0
4.13.0
The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.13.0.
Features
-
Add regex support for
ignore_exceptions
andignore_transactions
(#1850)You can now use regular expressions to ignore exceptions and transactions:
Sentry\init([ 'ignore_exceptions' => [ '/.*ArgumentException$/', ], 'ignore_transactions' => [ '/^GET \/api\/users\/\d+$/', ], ]);
-
Add support for variadic parameters and null values (#1849)
Bug Fixes
4.12.0
The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.12.0.
Features
-
Add support for Sentry Structured Logs (#1813)
You can now send logs directly to Sentry using the new logging API:
Sentry\init([ // Enable logs to be sent to Sentry 'enable_logs' => true, ]);
use function Sentry\logger; // Log messages at different levels logger()->info('User logged in', ['user_id' => 123]); logger()->warn('Deprecated function used', ['function' => 'old_function']); logger()->error('Database connection failed', ['host' => 'db.example.com']); logger()->fatal('Critical system failure: %s', ['Out of memory'], ['component' => 'database']); // Flush logs to Sentry logger()->flush(); // We recommend registering the flushing in a shutdown function register_shutdown_function(static fn () => logger()->flush());
To learn more, head over to our docs.
Bug Fixes
- Log correct source of sampling decision (#1836)