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

@@ -30,7 +30,7 @@ class LogglyHandler extends AbstractProcessingHandler
protected $token;
protected $tag = array();
protected $tag = [];
public function __construct($token, $level = Logger::DEBUG, $bubble = true)
{
@@ -45,14 +45,14 @@ class LogglyHandler extends AbstractProcessingHandler
public function setTag($tag)
{
$tag = !empty($tag) ? $tag : array();
$this->tag = is_array($tag) ? $tag : array($tag);
$tag = !empty($tag) ? $tag : [];
$this->tag = is_array($tag) ? $tag : [$tag];
}
public function addTag($tag)
{
if (!empty($tag)) {
$tag = is_array($tag) ? $tag : array($tag);
$tag = is_array($tag) ? $tag : [$tag];
$this->tag = array_unique(array_merge($this->tag, $tag));
}
}
@@ -79,7 +79,7 @@ class LogglyHandler extends AbstractProcessingHandler
{
$url = sprintf("https://%s/%s/%s/", self::HOST, $endpoint, $this->token);
$headers = array('Content-Type: application/json');
$headers = ['Content-Type: application/json'];
if (!empty($this->tag)) {
$headers[] = 'X-LOGGLY-TAG: '.implode(',', $this->tag);