Use dateTimeFOrmatter to format the date/time on log entries

pull/3551/head
Isaac Connor 2022-06-01 15:49:09 -04:00 committed by Isaac Connor
parent 278122f1d6
commit 97856b96df
1 changed files with 2 additions and 1 deletions

View File

@ -361,9 +361,10 @@ class Logger {
$string = preg_replace('/[\r\n]+$/', '', $string);
$code = self::$codes[$level];
global $dateTimeFormatter;
$time = gettimeofday();
$message = sprintf('%s.%06d %s[%d].%s [%s] [%s]',
date('%x %H:%M:%S', $time['sec']), $time['usec'],
$dateTimeFormatter->format($time['sec']), $time['usec'],
$this->id, getmypid(), $code, $_SERVER['REMOTE_ADDR'], $string);
if ( is_null($file) ) {