From 1e4b86d2284d49609068e803a5a0272822aff80e Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Sat, 7 Apr 2018 03:50:12 +0400 Subject: [PATCH] Use ISO 8601 date constant --- src/Monolog/Formatter/ElasticSearchFormatter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Monolog/Formatter/ElasticSearchFormatter.php b/src/Monolog/Formatter/ElasticSearchFormatter.php index 1ac9d2c7..56e4d2e4 100644 --- a/src/Monolog/Formatter/ElasticSearchFormatter.php +++ b/src/Monolog/Formatter/ElasticSearchFormatter.php @@ -11,6 +11,8 @@ namespace Monolog\Formatter; +use DateTime; + /** * Format a log message into an ElasticSearch record * @@ -35,7 +37,7 @@ class ElasticSearchFormatter extends NormalizerFormatter public function __construct($index, $type) { // 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->type = $type;