mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-31 02:10:22 +02:00
Merge pull request #1561 from thomasphansen/th_jsonformatter_use_formatdate
JsonFormatter::normalize() : respect date format from Formatter
This commit is contained in:
@@ -44,6 +44,8 @@ class JsonFormatter extends NormalizerFormatter
|
||||
$this->batchMode = $batchMode;
|
||||
$this->appendNewline = $appendNewline;
|
||||
$this->ignoreEmptyContextAndExtra = $ignoreEmptyContextAndExtra;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,6 +175,10 @@ class JsonFormatter extends NormalizerFormatter
|
||||
return $normalized;
|
||||
}
|
||||
|
||||
if ($data instanceof \DateTimeInterface) {
|
||||
return $this->formatDate($data);
|
||||
}
|
||||
|
||||
if ($data instanceof Throwable) {
|
||||
return $this->normalizeException($data, $depth);
|
||||
}
|
||||
|
Reference in New Issue
Block a user