Skip to content

Commit 384e885

Browse files
committed
ICL: Deduplication doc added.
1 parent 427b998 commit 384e885

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,34 @@ class Foo extends Command
250250
}
251251
```
252252

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 command.
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 command.
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+
Also, you can adjust deduplication time, by overridding `getNotificationDeduplicationTime` method:
261+
262+
```php
263+
class Foo extends Command
264+
{
265+
use Loggable;
266+
267+
protected function getNotificationDeduplication()
268+
{
269+
return true;
270+
}
271+
272+
protected function getNotificationDeduplicationTime()
273+
{
274+
return 90;
275+
}
276+
277+
// ...
278+
}
279+
```
280+
253281
#### Accessing Monolog instance
254282

255283
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)