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+ Sentry\init([
15+ // Enable logs to be sent to Sentry
16+ 'enable_logs' => true,
17+ ]);
18+ ```
19+
20+ ``` php
21+ use function Sentry\logger;
22+
23+ // Log messages at different levels
24+ logger()->info('User logged in', ['user_id' => 123]);
25+ logger()->warn('Deprecated function used', ['function' => 'old_function']);
26+ logger()->error('Database connection failed', ['host' => 'db.example.com']);
27+ logger()->fatal('Critical system failure: %s', ['Out of memory'], ['component' => 'database']);
28+
29+ // Flush logs to Sentry
30+ logger()->flush();
31+
32+ // We recommend registering the flushing in a shutdown function
33+ register_shutdown_function(static fn () => logger()->flush());
34+ ```
35+
36+ To learn more, head over to our [ docs] ( https://docs.sentry.io/platforms/php/logs/ ) .
37+
38+ ### Bug Fixes
39+
40+ - Log correct source of sampling decision [ (#1836 )] ( https://github.com/getsentry/sentry-php/pull/1836 )
41+
342## 4.11.1
443
544The 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