Skip to content

Commit d65e115

Browse files
authored
docs(laravel): Add logs beta troubleshooting steps (#14381)
1 parent 0bc1af8 commit d65e115

File tree

1 file changed

+30
-0
lines changed
  • docs/platforms/php/guides/laravel/logs

1 file changed

+30
-0
lines changed

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,33 @@ With Sentry Structured Logs, you can send text based log information from your L
2424
## Options
2525

2626
<PlatformContent includePath="logs/options" />
27+
28+
## Troubleshooting
29+
30+
If your logs are not appearing in Sentry, check or test the following:
31+
32+
Check your `config/logging.php` and ensure the default log channel and stack channel allow configuration using environment variables:
33+
34+
```php {filename:config/logging.php}
35+
// ...
36+
'default' => env('LOG_CHANNEL', 'stack'),
37+
// ...
38+
'channels' => [
39+
'stack' => [
40+
'driver' => 'stack',
41+
'channels' => explode(',', (string) env('LOG_STACK', 'single')),
42+
'ignore_exceptions' => false,
43+
],
44+
// ...
45+
```
46+
47+
Ensure that if you have defined the `LOG_LEVEL` in your `.env` file, it is set to a level that allows the logs you are expecting to be sent to Sentry.
48+
49+
To test your setup regardless of the Laravel configuration, you can send a test log message to Sentry with the following snippet:
50+
51+
```php
52+
\Sentry\logger()->info('A test log message');
53+
\Sentry\logger()->flush();
54+
```
55+
56+
If that does not work, check your DSN configuration using `php artisan sentry:test`.

0 commit comments

Comments
 (0)