I have a php script that checks the database every second(ish as not 100% important its on second) and writes the output to json files for a captioning system. This has a success log file
I want to log the quite times too.
I was logging to the last line with "." every time it ran.
2012-06-18 10:45:51 UTC | .........................
This can lead to very long line which might break future log checking system.
So I have change this for a line that runs every 5 minutes
// 2012-06-18 10:45:51 UTC | wait.
if ((int) date('i') % 5 == 0)
{
log ( $date . ' | wait. ' );
}
but this logs every second/iteration of every 5th minute. I could add seconds but it does not always run every 01 second.
Is there a way of logging once in n time?