Skip to content

Commit 351baef

Browse files
committed
ICL: Readme fixes.
1 parent 2083283 commit 351baef

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

README.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,35 @@ class Foo extends Command
217217
}
218218
```
219219
220+
#### Notifications deduplication
221+
222+
Often different console commands can produce similar errors. For example, maybe all of your commands are using some common external service. And if that service goes down, you'll get an error notification from each of your commands.
223+
Or, another example, probably you're using database server. If it goes down - again, you'll get an error notification from each of your commands.
224+
And this can be a problem, if you have a huge number of commands. You'll get hundreds of emails for a few hours.
225+
226+
The good news is that you can deduplicate notifications very easy. You can enable deduplication by overriding `getNotificationDeduplication` method.
227+
228+
Also, you can adjust deduplication time, by overridding `getNotificationDeduplicationTime` method:
229+
230+
```php
231+
class Foo extends Command
232+
{
233+
use Loggable;
234+
235+
protected function getNotificationDeduplication()
236+
{
237+
return true;
238+
}
239+
240+
protected function getNotificationDeduplicationTime()
241+
{
242+
return 90;
243+
}
244+
245+
// ...
246+
}
247+
```
248+
220249
#### Notifications mail driver
221250
222251
In order to send an email notifications, package would check `mail` configuration of your Laravel project.
@@ -250,35 +279,6 @@ class Foo extends Command
250279
}
251280
```
252281

253-
#### Notifications deduplication
254-
255-
Often different console commands can produce similar errors. For example, maybe all of your commands are using some common external service. And if that service goes down, you'll get an error notification from each of your commands.
256-
Or, another example, probably you're using database server. If it goes down - again, you'll get an error notification from each of your commands.
257-
And this can be a problem, if you have a huge number of commands. You'll get hundreds of emails for a few hours.
258-
259-
The good news is that you can deduplicate notifications very easy. You can enable deduplication by overriding `getNotificationDeduplication` method.
260-
261-
Also, you can adjust deduplication time, by overridding `getNotificationDeduplicationTime` method:
262-
263-
```php
264-
class Foo extends Command
265-
{
266-
use Loggable;
267-
268-
protected function getNotificationDeduplication()
269-
{
270-
return true;
271-
}
272-
273-
protected function getNotificationDeduplicationTime()
274-
{
275-
return 90;
276-
}
277-
278-
// ...
279-
}
280-
```
281-
282282
#### Accessing Monolog instance
283283

284284
This package is using [Monolog logging library](https://packagist.org/packages/monolog/monolog) with all of it's power and benefits.

0 commit comments

Comments
 (0)