Log with milliseconds

This commit is contained in:
OpenXE 2022-12-23 19:08:18 +01:00
parent 71861079e3
commit 135017158c
3 changed files with 4 additions and 4 deletions

View File

@ -66,7 +66,7 @@ final class DatabaseLogHandler extends AbstractLogHandler
$sql = 'INSERT INTO `log` $sql = 'INSERT INTO `log`
(`log_time`, `level`, `message`, `class`, `method`, `line`, `origin_type`, `origin_detail`, `dump`) (`log_time`, `level`, `message`, `class`, `method`, `line`, `origin_type`, `origin_detail`, `dump`)
VALUES VALUES
(NOW(), :level, :message, :class, :method, :line, :origin_type, :origin_detail, :dump)'; (NOW(3), :level, :message, :class, :method, :line, :origin_type, :origin_detail, :dump)';
$this->db->perform($sql, $values); $this->db->perform($sql, $values);
} }
} }

View File

@ -56922,7 +56922,7 @@
}, },
{ {
"Field": "log_time", "Field": "log_time",
"Type": "datetime", "Type": "datetime(3)",
"Collation": null, "Collation": null,
"Null": "YES", "Null": "YES",
"Key": "", "Key": "",

View File

@ -82,7 +82,7 @@ class Log
'Nachricht', 'Nachricht',
'', '',
]; ];
$width = ['1%', '4%', '8%', '4%', '10%', '15%', '20%', '10%', '5%', '40%']; $width = ['1%', '4%', '9%', '4%', '10%', '15%', '20%', '10%', '5%', '40%'];
$findcols = [ $findcols = [
'open', 'open',
'l.id', 'l.id',
@ -116,7 +116,7 @@ class Log
$sql = "SELECT l.id, $sql = "SELECT l.id,
'<img src=./themes/new/images/details_open.png class=details>' AS `open`, '<img src=./themes/new/images/details_open.png class=details>' AS `open`,
l.id, l.id,
DATE_FORMAT(l.log_time,'%d.%m.%Y %H:%i:%s') AS `log_time`, SUBSTRING(DATE_FORMAT(l.log_time,'%d.%m.%Y %H:%i:%s %f'),1,23) AS `log_time`,
l.level, l.origin_type, l.origin_detail, l.class, l.method, l.line, l.message, l.id l.level, l.origin_type, l.origin_detail, l.class, l.method, l.line, l.message, l.id
FROM `log` AS `l`"; FROM `log` AS `l`";
$fastcount = 'SELECT COUNT(l.id) FROM `log` AS `l`'; $fastcount = 'SELECT COUNT(l.id) FROM `log` AS `l`';