Tutorial Extension  1.0.0
SellerDeck Extensions - Tutorial Extension
AjaxStreamHandler.php
1 <?php
2 
3 namespace Monolog\Handler;
4 
6 
7 class AjaxStreamHandler extends StreamHandler
8  {
9 
10  public function __construct($level = Logger::DEBUG, $bubble = true, $filePermission = null)
11  {
12  parent::__construct("", $level, $bubble);
13  $this->filePermission = $filePermission;
14  }
15 
16  protected function write(array $record)
17  {
18 
19  echo "data: " . ((string) $record['formatted']) . "\n";
20  ob_flush();
21  flush();
22  }
23 
24  }