Skip to content

Monolog handler for limiting logging of similar records

License

Notifications You must be signed in to change notification settings

Magomogo/monolog-bubble

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

monolog-bubble

Monolog handler for limiting logging of similar records

use Bubble\CatchBubble;
use Bubble\MemcacheArray;
use Bubble\Monolog\BubbleHandler;

$log = new \Monolog\Logger(/*...*/);
$log->pushHandler(/*...*/); // this handler will log everything

$mailHandler = new \Monolog\Handler\NativeMailerHandler('support@example.com', 'Error report', 'noreply@example.com');
$mailHandler->setFormatter(/*...*/);

//$mailHandler will not pollute support mailbox with similar records more than once an hour
$log->pushHandler(new BubbleHandler($mailHandler, new CatchBubble('PT1H', new MemcacheArray())));
$log->pushProcessor(/*...*/);

\Monolog\ErrorHandler::register($log);

About

Monolog handler for limiting logging of similar records

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%