mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 12:47:39 +02:00
Use ISO 8601 date constant
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
namespace Monolog\Formatter;
|
namespace Monolog\Formatter;
|
||||||
|
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format a log message into an ElasticSearch record
|
* Format a log message into an ElasticSearch record
|
||||||
*
|
*
|
||||||
@@ -35,7 +37,7 @@ class ElasticSearchFormatter extends NormalizerFormatter
|
|||||||
public function __construct($index, $type)
|
public function __construct($index, $type)
|
||||||
{
|
{
|
||||||
// ElasticSearch requires an ISO 8601 format date with optional millisecond precision.
|
// ElasticSearch requires an ISO 8601 format date with optional millisecond precision.
|
||||||
parent::__construct('Y-m-d\TH:i:s.uP');
|
parent::__construct(DateTime::ISO8601);
|
||||||
|
|
||||||
$this->index = $index;
|
$this->index = $index;
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
|
Reference in New Issue
Block a user