github getsentry/sentry-php 4.12.0

latest releases: 4.15.2, 4.15.1, 4.15.0...
3 months ago

The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.12.0.

Features

  • Add support for Sentry Structured Logs (#1813)

    You can now send logs directly to Sentry using the new logging API:

    Sentry\init([
        // Enable logs to be sent to Sentry
        'enable_logs' => true,
    ]);
    use function Sentry\logger;
    
    // Log messages at different levels
    logger()->info('User logged in', ['user_id' => 123]);
    logger()->warn('Deprecated function used', ['function' => 'old_function']);
    logger()->error('Database connection failed', ['host' => 'db.example.com']);
    logger()->fatal('Critical system failure: %s', ['Out of memory'], ['component' => 'database']);
    
    // Flush logs to Sentry
    logger()->flush();
    
    // We recommend registering the flushing in a shutdown function
    register_shutdown_function(static fn () => logger()->flush());

    To learn more, head over to our docs.

Bug Fixes

  • Log correct source of sampling decision (#1836)

Don't miss a new sentry-php release

NewReleases is sending notifications on new releases.