Milliseconds are now fully supported

This commit is contained in:
Pinga 2023-11-09 00:33:02 +02:00
parent ea754362f8
commit 63aa36ff0a
13 changed files with 425 additions and 321 deletions

View file

@ -107,7 +107,10 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pdo)
if ($fp = @fopen("/var/log/das/das_request.log",'a')) {
$clientInfo = $server->getClientInfo($fd);
$remoteAddr = $clientInfo['remote_ip'];
fwrite($fp,date('Y-m-d H:i:s')."\t-\t".$remoteAddr."\t-\t".$domain."\n");
$currentDateTime = new DateTime();
$milliseconds = $currentDateTime->format("v");
$timestampWithMilliseconds = $currentDateTime->format("Y-m-d H:i:s") . '.' . $milliseconds;
fwrite($fp, $timestampWithMilliseconds . "\t-\t" . $remoteAddr . "\t-\t" . $domain . "\n");
fclose($fp);
}
$server->close($fd);
@ -117,7 +120,10 @@ $server->on('receive', function ($server, $fd, $reactorId, $data) use ($c, $pdo)
if ($fp = @fopen("/var/log/das/das_not_found.log",'a')) {
$clientInfo = $server->getClientInfo($fd);
$remoteAddr = $clientInfo['remote_ip'];
fwrite($fp,date('Y-m-d H:i:s')."\t-\t".$remoteAddr."\t-\t".$domain."\n");
$currentDateTime = new DateTime();
$milliseconds = $currentDateTime->format("v");
$timestampWithMilliseconds = $currentDateTime->format("Y-m-d H:i:s") . '.' . $milliseconds;
fwrite($fp, $timestampWithMilliseconds . "\t-\t" . $remoteAddr . "\t-\t" . $domain . "\n");
fclose($fp);
}
$server->close($fd);