From 9a5e98047191b49d8f57b2f9a342ddc2844abf81 Mon Sep 17 00:00:00 2001 From: Terence Eden Date: Mon, 19 Feb 2024 10:46:18 +0000 Subject: [PATCH] Log files use DATE_RFC3339_EXTENDED This addresses !7 Log files now use milliseconds in their filename. This should be sufficient for small servers. --- index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index c23be07..82137f8 100644 --- a/index.php +++ b/index.php @@ -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";