1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 17:16:18 +02:00
This commit is contained in:
Jordi Boggiano
2016-05-26 20:54:06 +01:00
parent 85e43a5e7b
commit f200e79879
115 changed files with 1138 additions and 1123 deletions

View File

@@ -24,15 +24,15 @@ class CouchDBHandler extends AbstractProcessingHandler
{
private $options;
public function __construct(array $options = array(), $level = Logger::DEBUG, $bubble = true)
public function __construct(array $options = [], $level = Logger::DEBUG, $bubble = true)
{
$this->options = array_merge(array(
$this->options = array_merge([
'host' => 'localhost',
'port' => 5984,
'dbname' => 'logger',
'username' => null,
'password' => null,
), $options);
], $options);
parent::__construct($level, $bubble);
}
@@ -48,15 +48,15 @@ class CouchDBHandler extends AbstractProcessingHandler
}
$url = 'http://'.$basicAuth.$this->options['host'].':'.$this->options['port'].'/'.$this->options['dbname'];
$context = stream_context_create(array(
'http' => array(
$context = stream_context_create([
'http' => [
'method' => 'POST',
'content' => $record['formatted'],
'ignore_errors' => true,
'max_redirects' => 0,
'header' => 'Content-type: application/json',
),
));
],
]);
if (false === @file_get_contents($url, null, $context)) {
throw new \RuntimeException(sprintf('Could not connect to %s', $url));