You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
2
-
3
-
```php {filename:config/logging.php}
4
-
'channels' => [
5
-
// ...
6
-
'sentry_logs' => [
7
-
'driver' => 'sentry_logs',
8
-
// The minimum logging level at which this handler will be triggered
'level' => env('LOG_LEVEL', 'info'), // defaults to `debug` if not set
11
-
],
12
-
],
13
-
```
14
-
15
-
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:
1
+
To configure Sentry logs, you need to set the following variables in your `.env` file:
16
2
17
3
```bash {filename:.env}
18
4
# ...
@@ -29,4 +15,34 @@ SENTRY_ENABLE_LOGS=true
29
15
# ...
30
16
```
31
17
18
+
You can configure your log level by setting `LOG_LEVEL` or if you want a log level just for Sentry, you can use
19
+
`SENTRY_LOG_LEVEL`:
20
+
21
+
```bash {filename:.env}
22
+
# ...
23
+
LOG_LEVEL=info # defaults to debug
24
+
SENTRY_LOG_LEVEL=warning # defaults to LOG_LEVEL
25
+
# ...
26
+
```
27
+
32
28
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).
29
+
30
+
<Alerttitle="Note">
31
+
32
+
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.
33
+
34
+
</Alert>
35
+
36
+
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.
37
+
38
+
```php {filename:config/logging.php}
39
+
'channels' => [
40
+
// ...
41
+
'sentry_logs' => [
42
+
'driver' => 'sentry_logs',
43
+
// The minimum logging level at which this handler will be triggered
0 commit comments