1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 09:06:10 +02:00

Better PSR-3 message formatting

This commit is contained in:
Lars Strojny
2017-04-13 00:06:26 +02:00
parent 71afce5df7
commit 85d49f8568
2 changed files with 8 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ namespace Monolog\Processor;
*/
class PsrLogMessageProcessor
{
const SIMPLE_DATE = "Y-m-d\TH:i:sP";
const SIMPLE_DATE = "Y-m-d\TH:i:s.uP";
private $dateFormat;
@@ -60,6 +60,8 @@ class PsrLogMessageProcessor
$replacements[$placeholder] = $val->format($this->dateFormat);
} elseif (is_object($val)) {
$replacements[$placeholder] = '[object '.get_class($val).']';
} elseif (is_array($val)) {
$replacements[$placeholder] = 'array'.@json_encode($val);
} else {
$replacements[$placeholder] = '['.gettype($val).']';
}