File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 11# CHANGELOG
22
3+ ## 4.15.0
4+
5+ The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.15.0.
6+
7+ ### Features
8+
9+ - Add Monolog Sentry Logs handler [ (#1867 )] ( https://github.com/getsentry/sentry-php/pull/1867 )
10+
11+ This new handler allows you to capture Monolog logs as Sentry logs. To use it, configure your Monolog logger:
12+
13+ ``` php
14+ use Monolog\Logger;
15+ use Sentry\Monolog\LogsHandler;
16+ use Sentry\Logs\LogLevel;
17+
18+ // Initialize Sentry SDK first (make sure 'enable_logs' is set to true)
19+ \Sentry\init([
20+ 'dsn' => '__YOUR_DSN__',
21+ 'enable_logs' => true,
22+ ]);
23+
24+ // Create a Monolog logger
25+ $logger = new Logger('my-app');
26+
27+ // Add the Sentry logs handler
28+ // Optional: specify minimum log level (defaults to LogLevel::debug())
29+ $handler = new LogsHandler(LogLevel::info());
30+ $logger->pushHandler($handler);
31+
32+ // Now your logs will be sent to Sentry
33+ $logger->info('User logged in', ['user_id' => 123]);
34+ $logger->error('Payment failed', ['order_id' => 456]);
35+ ```
36+
37+ Note: The handler will not collect logs for exceptions (they should be handled separately via ` captureException ` ).
38+
39+ ### Bug Fixes
40+
41+ - Fix non string indexed attributes passed as log attributes [ (#1882 )] ( https://github.com/getsentry/sentry-php/pull/1882 )
42+ - Use correct ` sample_rate ` key when deriving sampleRand [ (#1874 )] ( https://github.com/getsentry/sentry-php/pull/1874 )
43+ - Do not call ` Reflection*::setAccessible() ` in PHP >= 8.1 [ (#1872 )] ( https://github.com/getsentry/sentry-php/pull/1872 )
44+
345## 4.14.2
446
547The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.14.2.
You can’t perform that action at this time.
0 commit comments