From 6a67cf3328518976ae53d02e588bc4c16a914f5a Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Thu, 9 Oct 2025 15:36:05 +0200 Subject: [PATCH 1/4] ref: add docs that logs channel is optional --- platform-includes/logs/setup/php.laravel.mdx | 48 +++++++++++++------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/platform-includes/logs/setup/php.laravel.mdx b/platform-includes/logs/setup/php.laravel.mdx index 1d651b081c7b6..3a89d51e78f5c 100644 --- a/platform-includes/logs/setup/php.laravel.mdx +++ b/platform-includes/logs/setup/php.laravel.mdx @@ -1,20 +1,4 @@ -To configure Sentry as a log channel, add the following config to the `channels` section in `config/logging.php`. If this file does not exist, run `php artisan config:publish logging` to publish it. - -```php {filename:config/logging.php} -'channels' => [ - // ... - 'sentry_logs' => [ - 'driver' => 'sentry_logs', - // The minimum logging level at which this handler will be triggered - // Available levels: debug, info, notice, warning, error, critical, alert, emergency - 'level' => env('LOG_LEVEL', 'info'), // defaults to `debug` if not set - ], -], -``` - -After you configured the Sentry log channel, you can configure your app to both log to a log file and to Sentry by modifying the log stack: - -```bash {filename:.env} +import {Alert} from "../../../src/components/alert";```bash {filename:.env} # ... LOG_CHANNEL=stack LOG_STACK=single,sentry_logs @@ -29,4 +13,34 @@ SENTRY_ENABLE_LOGS=true # ... ``` +You can configure your log level by setting `LOG_LEVEL` or if you want a log level just for Sentry, you can use +`SENTRY_LOG_LEVEL`: + +```bash {filename:.env} +# ... +LOG_LEVEL=info # defaults to debug +SENTRY_LOG_LEVEL=warning # defaults to LOG_LEVEL +# ... +``` + Also make sure your `config/sentry.php` file is up to date. You can find the latest version on [GitHub](https://github.com/getsentry/sentry-laravel/blob/master/config/sentry.php). + + + +If you are using the Sentry Laravel SDK version `4.16.0` or lower, you need to configure the log channel manually as described below. + + + +To configure Sentry as a log channel, add the following config to the `channels` section in `config/logging.php`. If this file does not exist, run `php artisan config:publish logging` to publish it. + +```php {filename:config/logging.php} +'channels' => [ + // ... + 'sentry_logs' => [ + 'driver' => 'sentry_logs', + // The minimum logging level at which this handler will be triggered + // Available levels: debug, info, notice, warning, error, critical, alert, emergency + 'level' => env('LOG_LEVEL', 'info'), // defaults to `debug` if not set + ], +], +``` From 439e46dcb51de4b3049daff817077c8bed3182a8 Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Tue, 14 Oct 2025 15:54:29 +0200 Subject: [PATCH 2/4] update --- platform-includes/logs/setup/php.laravel.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/logs/setup/php.laravel.mdx b/platform-includes/logs/setup/php.laravel.mdx index 3a89d51e78f5c..6763ccf3dcef9 100644 --- a/platform-includes/logs/setup/php.laravel.mdx +++ b/platform-includes/logs/setup/php.laravel.mdx @@ -1,4 +1,4 @@ -import {Alert} from "../../../src/components/alert";```bash {filename:.env} +```bash {filename:.env} # ... LOG_CHANNEL=stack LOG_STACK=single,sentry_logs From 31e024c13c2b62ecd5792fd738133b36b5e525fe Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Tue, 14 Oct 2025 17:18:26 +0200 Subject: [PATCH 3/4] update --- platform-includes/logs/setup/php.laravel.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform-includes/logs/setup/php.laravel.mdx b/platform-includes/logs/setup/php.laravel.mdx index 6763ccf3dcef9..1448f11fa6b08 100644 --- a/platform-includes/logs/setup/php.laravel.mdx +++ b/platform-includes/logs/setup/php.laravel.mdx @@ -1,3 +1,5 @@ +To configure Sentry logs, you need to set the following variables in your `.env` file: + ```bash {filename:.env} # ... LOG_CHANNEL=stack From 8730f3ae1928315d2315892855f63a7004c35b3b Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Wed, 15 Oct 2025 11:28:42 +0200 Subject: [PATCH 4/4] update note --- platform-includes/logs/setup/php.laravel.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/logs/setup/php.laravel.mdx b/platform-includes/logs/setup/php.laravel.mdx index 1448f11fa6b08..6071f97d3482b 100644 --- a/platform-includes/logs/setup/php.laravel.mdx +++ b/platform-includes/logs/setup/php.laravel.mdx @@ -29,7 +29,7 @@ Also make sure your `config/sentry.php` file is up to date. You can find the lat -If you are using the Sentry Laravel SDK version `4.16.0` or lower, you need to configure the log channel manually as described below. +If you’re using the Sentry Laravel SDK version `4.16.0` and below, or if you want to define the channel yourself to pass additional options, configure the log channel manually as described below.