From cc5c1a832fb0cc3063fb0d353327ac467e360468 Mon Sep 17 00:00:00 2001 From: Arnaud Becher Date: Tue, 25 Sep 2018 13:29:38 +0200 Subject: [PATCH 1/2] fix readme with name attribute for logging channels in laravel 5.6+ --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bf988849..6ba7f95f 100644 --- a/README.md +++ b/README.md @@ -247,15 +247,28 @@ After you configured the Sentry log channel you can configure your app to both l ```php 'channels' => [ - 'stack' => [ + 'my_stacked_channel' => [ 'driver' => 'stack', // Add the Sentry log channel to the stack 'channels' => ['single', 'sentry'], + 'name' => 'my-channel' ], //... ], ``` +You're now able to log errors to your chanel: + +```php +Log::channel('my_stacked_channel')->error('My error'); +``` + +and sentry's `logger` tag has now the channel's "name" value (that you can easily filter): + +![logger-name-screenshot](https://i.imgur.com/n3wc6md.png) + + + Optionally you can set the logging level and if events should bubble on the driver: ```php From 94c8b2dc065dd5e920c804e0a0936f51a48eed90 Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Tue, 25 Sep 2018 14:04:53 +0200 Subject: [PATCH 2/2] Little updates to custom log channel name docs --- README.md | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6ba7f95f..f612504e 100644 --- a/README.md +++ b/README.md @@ -247,28 +247,15 @@ After you configured the Sentry log channel you can configure your app to both l ```php 'channels' => [ - 'my_stacked_channel' => [ + 'stack' => [ 'driver' => 'stack', // Add the Sentry log channel to the stack 'channels' => ['single', 'sentry'], - 'name' => 'my-channel' ], //... ], ``` -You're now able to log errors to your chanel: - -```php -Log::channel('my_stacked_channel')->error('My error'); -``` - -and sentry's `logger` tag has now the channel's "name" value (that you can easily filter): - -![logger-name-screenshot](https://i.imgur.com/n3wc6md.png) - - - Optionally you can set the logging level and if events should bubble on the driver: ```php @@ -283,6 +270,32 @@ Optionally you can set the logging level and if events should bubble on the driv ], ``` +### Naming you log channels + +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, +it will show up in Sentry as the `logger` tag which is filterable. + +For example: + +```php +'channels' => [ + 'my_stacked_channel' => [ + 'driver' => 'stack', + 'channels' => ['single', 'sentry'], + 'name' => 'my-channel' + ], + //... +], +``` + +You're now able to log errors to your channel: + +```php +\Log::channel('my_stacked_channel')->error('My error'); +``` + +And sentry's `logger` tag has now the channel's `name` "my-channel" value where you can filter on. + ## Resolve name conflicts with packages also called Sentry