Skip to content

Commit db2f5ab

Browse files
authored
Fix Laravel Logs docs (#14055)
1 parent 70e606c commit db2f5ab

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

docs/platforms/php/guides/laravel/usage/index.mdx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,10 @@ If this file does not exist, run `php artisan config:publish logging` to publish
110110

111111
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:
112112

113-
```php {filename:config/logging.php}
114-
'channels' => [
115-
'stack' => [
116-
'driver' => 'stack',
117-
// Add the Sentry log channel to the stack
118-
'channels' => ['single', 'sentry'],
119-
],
120-
//...
121-
],
113+
```bash {filename:.env}
114+
# ...
115+
LOG_STACK=single,sentry
116+
# ...
122117
```
123118

124119
Optionally, you can set the [logging level](https://laravel.com/docs/8.x/logging#log-levels) and if events should bubble on the driver:

platform-includes/logs/setup/php.laravel.mdx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ To configure Sentry as a log channel, add the following config to the `channels`
33
```php {filename:config/logging.php}
44
'channels' => [
55
// ...
6-
'sentry' => [
7-
'driver' => 'sentry',
6+
'sentry_logs' => [
7+
'driver' => 'sentry_logs',
88
],
99
],
1010
```
@@ -13,7 +13,15 @@ After you configured the Sentry log channel, you can configure your app to both
1313

1414
```bash {filename:.env}
1515
# ...
16-
LOG_STACK=single,sentry
16+
LOG_STACK=single,sentry_logs
17+
# ...
18+
```
19+
20+
You will also need to configure the Sentry Laravel SDK to enable the logging integration. You can do this by updating your `.env` file to include the following:
21+
22+
```bash {filename:.env}
23+
# ...
24+
SENTRY_ENABLE_LOGS=true
1725
# ...
1826
```
1927

@@ -22,11 +30,11 @@ Optionally, you can set the logging level:
2230
```php {filename:config/logging.php}
2331
'channels' => [
2432
// ...
25-
'sentry' => [
33+
'sentry_logs' => [
2634
'driver' => 'sentry_logs',
2735
// The minimum logging level at which this handler will be triggered
2836
// Available levels: debug, info, notice, warning, error, critical, alert, emergency
29-
'level' => env('LOG_LEVEL', 'error'),
37+
'level' => env('LOG_LEVEL', 'info'), // defaults to `debug` if not set
3038
],
3139
// ...
3240
],

0 commit comments

Comments
 (0)