Skip to content

Releases: getsentry/sentry-php

4.16.0

22 Sep 13:46
Compare
Choose a tag to compare

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

Features

  • Remove max_breadcrumbs limit. (#1890)
  • Implement __destruct in LogsHandler to make sure logs are always flushed. (#1916)

Bug Fixes

  • Use PSR log level when logging messages using the PSR-3 logger within the SDK. (#1907)
  • Remove @internal annotation from Sentry\Transport\Result. (#1904)

Misc

  • Add sentry.origin attribute to LogsHandler. (#1917)

4.15.2

03 Sep 07:26
Compare
Choose a tag to compare

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

Bug Fixes

  • Ensure the Monolog handler only processes records permitted by their log level. (#1888)

4.15.1

28 Aug 15:48
Compare
Choose a tag to compare

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

Bug Fixes

  • Do not send template attribute with logs when there are no template values (#1885)

4.15.0

20 Aug 14:29
Compare
Choose a tag to compare

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)

    This new handler allows you to capture Monolog logs as Sentry logs. To use it, configure your Monolog logger:

    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).

Bug Fixes

  • Fix non string indexed attributes passed as log attributes (#1882)
  • Use correct sample_rate key when deriving sampleRand (#1874)
  • Do not call Reflection*::setAccessible() in PHP >= 8.1 (#1872)

4.14.2

21 Jul 08:35
Compare
Choose a tag to compare

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

Bug Fixes

  • Add missing sample rates in the envelope header (#1870)

4.14.1

23 Jun 15:37
Compare
Choose a tag to compare

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

Bug Fixes

  • Fix missing user attributes on logs (#1864)

4.14.0

13 Jun 17:25
Compare
Choose a tag to compare

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

Features

  • Serialize enum variants with the variant name (#1860)

Bug Fixes

  • Fix handling of backtrace frames (#1862)
  • Set allowed types for http_ssl_native_ca (#1858)

4.13.0

10 Jun 15:54
Compare
Choose a tag to compare

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

Features

  • Add regex support for ignore_exceptions and ignore_transactions (#1850)

    You can now use regular expressions to ignore exceptions and transactions:

    Sentry\init([
        'ignore_exceptions' => [
            '/.*ArgumentException$/',
        ],
        'ignore_transactions' => [
            '/^GET \/api\/users\/\d+$/',
        ],
    ]);
  • Add support for variadic parameters and null values (#1849)

Bug Fixes

  • Fix Options::setEnableLogs (#1852)
  • Fix vsprintf not handling errors (#1855)

4.12.0

07 Jun 08:48
0173702
Compare
Choose a tag to compare

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)

4.11.1

12 May 11:40
Compare
Choose a tag to compare

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

Bug Fixes

  • Fix stripping prefixes from closure frames for PHP 8.4 and up (#1828)