Commit 2b50dc3f authored by Côme Chilliet's avatar Côme Chilliet

🚑 fix(logging) Store microseconds in audit datetime

This avoids having too many audit events on the same timestamp.

issue #5995
parent 78f07cb3
......@@ -61,7 +61,7 @@ class logging
/* Create data object */
$entry = [
'timestamp' => time(),
'timestamp' => microtime(TRUE),
'action' => $action,
'objecttype' => $objecttype,
'object' => $object,
......@@ -144,7 +144,7 @@ class logging
}
$tabObject = objects::create('auditEvent');
$baseObject = $tabObject->getBaseObject();
$baseObject->fdAuditDateTime = new DateTime('@'.$entry['timestamp']);
$baseObject->fdAuditDateTime = DateTime::createFromFormat('U.u', number_format($entry['timestamp'], 6, '.', ''));
$baseObject->fdAuditAction = $entry['action'];
$baseObject->fdAuditAuthorDN = $entry['user'];
$baseObject->fdAuditObjectType = $entry['objecttype'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment