FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Http.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Rsi\Fred\Log\Handler;
4 
5 class Http extends \Rsi\Fred\Log\Handler{
6 
7  public $endpoint = null;
8  public $timeout = 1;
9 
10  public function add($prio,$message,$context){
11  if($this->endpoint) file_get_contents($this->endpoint,0,stream_context_create(['http' => [
12  'method' => 'POST',
13  'header' => 'Content-Type: application/x-www-form-urlencoded',
14  'content' => http_build_query(compact('prio','message','context') + ['time' => time()]),
15  'timeout' => $this->timeout
16  ]]));
17  }
18 
19 }
add($prio, $message, $context)
Definition: Http.php:10