diff --git a/CHANGELOG.md b/CHANGELOG.md index d604d9e5d..8c8efe226 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,47 @@ # CHANGELOG +## 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)](https://github.com/getsentry/sentry-php/pull/1867) + + This new handler allows you to capture Monolog logs as Sentry logs. To use it, configure your Monolog logger: + + ```php + 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 + +- Fix non string indexed attributes passed as log attributes [(#1882)](https://github.com/getsentry/sentry-php/pull/1882) +- Use correct `sample_rate` key when deriving sampleRand [(#1874)](https://github.com/getsentry/sentry-php/pull/1874) +- Do not call `Reflection*::setAccessible()` in PHP >= 8.1 [(#1872)](https://github.com/getsentry/sentry-php/pull/1872) + ## 4.14.2 The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.14.2.