Skip to content

Commit 856170b

Browse files
authored
Merge pull request #152 from smknstd/channel-name-documentation
fix readme with name attribute for logging channels in laravel 5.6+
2 parents 55723ec + 94c8b2d commit 856170b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,32 @@ Optionally you can set the logging level and if events should bubble on the driv
270270
],
271271
```
272272

273+
### Naming you log channels
274+
275+
If you have multiple log channels you would like to filter on inside the Sentry interface you can add the `name` attribute to the log channel,
276+
it will show up in Sentry as the `logger` tag which is filterable.
277+
278+
For example:
279+
280+
```php
281+
'channels' => [
282+
'my_stacked_channel' => [
283+
'driver' => 'stack',
284+
'channels' => ['single', 'sentry'],
285+
'name' => 'my-channel'
286+
],
287+
//...
288+
],
289+
```
290+
291+
You're now able to log errors to your channel:
292+
293+
```php
294+
\Log::channel('my_stacked_channel')->error('My error');
295+
```
296+
297+
And sentry's `logger` tag has now the channel's `name` "my-channel" value where you can filter on.
298+
273299

274300
## Resolve name conflicts with packages also called Sentry
275301

0 commit comments

Comments
 (0)