From ba33d605fc165fb2e9b39676d1c756c1589a7b1b Mon Sep 17 00:00:00 2001 From: Michi Hoffmann Date: Wed, 22 Nov 2023 16:38:33 +0100 Subject: [PATCH] Add new PHP config options (#8552) --- .../ignore-exceptions/php.laravel.mdx | 5 +++++ .../configuration/ignore-exceptions/php.mdx | 7 ++++++ .../ignore-transactions/php.laravel.mdx | 5 +++++ .../configuration/ignore-transactions/php.mdx | 7 ++++++ .../configuration/logger/php.laravel.mdx | 7 ++++++ .../configuration/logger/php.mdx | 11 ++++++++++ .../common/configuration/filtering.mdx | 18 +++++++++++++++ .../common/configuration/options.mdx | 22 +++++++++++++++++++ 8 files changed, 82 insertions(+) create mode 100644 src/platform-includes/configuration/ignore-exceptions/php.laravel.mdx create mode 100644 src/platform-includes/configuration/ignore-exceptions/php.mdx create mode 100644 src/platform-includes/configuration/ignore-transactions/php.laravel.mdx create mode 100644 src/platform-includes/configuration/ignore-transactions/php.mdx create mode 100644 src/platform-includes/configuration/logger/php.laravel.mdx create mode 100644 src/platform-includes/configuration/logger/php.mdx diff --git a/src/platform-includes/configuration/ignore-exceptions/php.laravel.mdx b/src/platform-includes/configuration/ignore-exceptions/php.laravel.mdx new file mode 100644 index 0000000000000..9ef62d34d39ea --- /dev/null +++ b/src/platform-includes/configuration/ignore-exceptions/php.laravel.mdx @@ -0,0 +1,5 @@ +```php {filename:config/sentry.php} +'ignore_exceptions' => [ + UnauthenticatedException::class, +], +``` diff --git a/src/platform-includes/configuration/ignore-exceptions/php.mdx b/src/platform-includes/configuration/ignore-exceptions/php.mdx new file mode 100644 index 0000000000000..d8f718476c308 --- /dev/null +++ b/src/platform-includes/configuration/ignore-exceptions/php.mdx @@ -0,0 +1,7 @@ +```php +\Sentry\init([ + 'ignore_exceptions' => [ + UnauthenticatedException::class, + ], +]); +``` diff --git a/src/platform-includes/configuration/ignore-transactions/php.laravel.mdx b/src/platform-includes/configuration/ignore-transactions/php.laravel.mdx new file mode 100644 index 0000000000000..d6bcc12ac0691 --- /dev/null +++ b/src/platform-includes/configuration/ignore-transactions/php.laravel.mdx @@ -0,0 +1,5 @@ +```php {filename:config/sentry.php} +'ignore_transactions' => [ + 'GET /health', +], +``` diff --git a/src/platform-includes/configuration/ignore-transactions/php.mdx b/src/platform-includes/configuration/ignore-transactions/php.mdx new file mode 100644 index 0000000000000..db7daab1d7fbe --- /dev/null +++ b/src/platform-includes/configuration/ignore-transactions/php.mdx @@ -0,0 +1,7 @@ +```php +\Sentry\init([ + 'ignore_transactions' => [ + 'GET /health', + ], +]); +``` diff --git a/src/platform-includes/configuration/logger/php.laravel.mdx b/src/platform-includes/configuration/logger/php.laravel.mdx new file mode 100644 index 0000000000000..fa0a471753165 --- /dev/null +++ b/src/platform-includes/configuration/logger/php.laravel.mdx @@ -0,0 +1,7 @@ +```php {filename:config/sentry.php} +// This logs messages to the provided file path +'logger' => new \Sentry\Logger\DebugFileLogger(filePath: storage_path('logs/sentry.log')), + +// This logs messages to stdout +'logger' => new \Sentry\Logger\DebugStdOutLogger(), +``` diff --git a/src/platform-includes/configuration/logger/php.mdx b/src/platform-includes/configuration/logger/php.mdx new file mode 100644 index 0000000000000..22f0fa756f35e --- /dev/null +++ b/src/platform-includes/configuration/logger/php.mdx @@ -0,0 +1,11 @@ +```php +// This logs messages to the provided file path +Sentry\init([ + 'logger' => new \Sentry\Logger\DebugFileLogger(filePath: ROOT . DS . 'sentry.log'), +]); + +// This logs messages to stdout +Sentry\init([ + 'logger' => new \Sentry\Logger\DebugStdOutLogger(), +]); +``` diff --git a/src/platforms/common/configuration/filtering.mdx b/src/platforms/common/configuration/filtering.mdx index 774e019f96cbf..9a3bd6bf47857 100644 --- a/src/platforms/common/configuration/filtering.mdx +++ b/src/platforms/common/configuration/filtering.mdx @@ -84,6 +84,15 @@ You can use the option to filter out + + +### Using + +You can use the option to filter out errors that match a type or subtype. + + + + ### Decluttering Sentry @@ -129,4 +138,13 @@ You can use the option to filt + + +### Using + +You can use the option to filter out transactions that match a certain string. + + + + diff --git a/src/platforms/common/configuration/options.mdx b/src/platforms/common/configuration/options.mdx index 7dae49d29ddfb..df461b9dd3dbc 100644 --- a/src/platforms/common/configuration/options.mdx +++ b/src/platforms/common/configuration/options.mdx @@ -66,6 +66,15 @@ Turns debug mode on or off. If debug is enabled SDK will attempt to print out us + + +If enabled, the SDK prints out debug information about if something went wrong while sending events. +It isn't recommended to use this in production. + + + + + Enabling `debug` mode makes the SDK generate as much diagnostic data as possible. However, if you'd prefer to lower the verbosity of the Sentry SDK diagnostics logs, configure this option to set the appropriate level: @@ -293,12 +302,25 @@ For ASP.NET and ASP.NET Core applications, the value will default to the server' + + +A list of class names that matches exceptions that shouldn't be sent to Sentry. +Checks whether the provided class name is of a given type or subtype. + + + + + +A list of strings that match transaction names that shouldn't be sent to Sentry. + + +