File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# CHANGELOG
22
3+ ## 4.12.0
4+
5+ The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.12.0.
6+
7+ ### Features
8+
9+ - Add support for Sentry Structured Logs [ (#1813 )] ( https://github.com/getsentry/sentry-php/pull/1813 )
10+
11+ You can now send logs directly to Sentry using the new logging API:
12+
13+ ``` php
14+ use function Sentry\logger;
15+
16+ // Log messages at different levels
17+ logger()->info('User logged in', ['user_id' => 123]);
18+ logger()->warn('Deprecated function used', ['function' => 'old_function']);
19+ logger()->error('Database connection failed', ['host' => 'db.example.com']);
20+ logger()->fatal('Critical system failure: %s', ['Out of memory'], ['component' => 'database']);
21+
22+ // Flush logs to Sentry
23+ logger()->flush();
24+
25+ // We recommend registering the flushing in a shutdown function
26+ register_shutdown_function(static fn () => logger()->flush());
27+ ```
28+
29+ To learn more, head over to our [ docs] ( https://docs.sentry.io/platforms/php/logs/ ) .
30+
31+ ### Bug Fixes
32+
33+ - Log correct source of sampling decision [ (#1836 )] ( https://github.com/getsentry/sentry-php/pull/1836 )
34+
335## 4.11.1
436
537The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.11.1.
You can’t perform that action at this time.
0 commit comments