Log files use DATE_RFC3339_EXTENDED

This addresses !7

Log files now use milliseconds in their filename. This should be sufficient for small servers.
merge-requests/5/head
Terence Eden 2024-02-19 10:46:18 +00:00
rodzic f2c6a4afa0
commit 9a5e980471
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -60,8 +60,11 @@
$type = "";
}
// Create a timestamp in ISO 8601 format for the filename
$timestamp = date( "c" );
// Create a timestamp for the filename
// This format has milliseconds, so should avoid logs being overwritten.
// If you have > 1000 requests per second, please use a different server.
$timestamp = ( new DateTime() )->format( DATE_RFC3339_EXTENDED );
// Filename for the log
$filename = "{$timestamp}{$type}.txt";