From fc859ec2895bf3da39d2509a2a0d78136c1418e8 Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Thu, 14 Aug 2025 14:04:33 +0200 Subject: [PATCH 1/2] Prepare 4.15.0 --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d604d9e5d..37f15fdcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # 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) + +### Bug Fixes + +- 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) + +### Misc + +- Refactor trace header parsing logic [(#1876)](https://github.com/getsentry/sentry-php/pull/1876) +- Add link to Joomla! integration [(#1868)](https://github.com/getsentry/sentry-php/pull/1868) + ## 4.14.2 The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.14.2. From 4349f279c31226f46b2e65c6127267816b5a0c95 Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Wed, 20 Aug 2025 16:20:57 +0200 Subject: [PATCH 2/2] Prepare 4.15.0 --- CHANGELOG.md | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37f15fdcd..8c8efe226 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,15 +8,39 @@ The Sentry SDK team is happy to announce the immediate availability of Sentry PH - Add Monolog Sentry Logs handler [(#1867)](https://github.com/getsentry/sentry-php/pull/1867) -### Bug Fixes + This new handler allows you to capture Monolog logs as Sentry logs. To use it, configure your Monolog logger: -- 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) + ```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`). -### Misc +### Bug Fixes -- Refactor trace header parsing logic [(#1876)](https://github.com/getsentry/sentry-php/pull/1876) -- Add link to Joomla! integration [(#1868)](https://github.com/getsentry/sentry-php/pull/1868) +- 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