On Friday 06 August 2004 02:50, Sarah Gray wrote:

> I am having a periodic problem that I cannot duplicate and wonder if
> anyone has suggestions.
>
> Once a sale is completed a record is written to a log file on the
> server.
>
> $filename = $dir. "/". $logType."_".$today.".txt";
> $fp = fopen("$filename", "a+");
> fputs($fp, $logEntryStr);
> fclose($fp);
>
> The file is chmoded to 644.
>
> About 3 out of 600 times, the log file is not written to.  The times
> of day this happens are not consistent, and as I mentioned, I cannot
> duplicate it when testing. I initially thought it was some kind of
> error on the server, but I am beginning to think it is in my code.
>
> Has anyone experienced anything like this or have any suggestions for
> how to troubleshoot this?

- Enable full error reporting for PHP.

- Incorporate some error checking code as per example in manual for fwrite().

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Q:      How many Zen masters does it take to screw in a light bulb?
A:      None.  The Universe spins the bulb, and the Zen master stays out
        of the way.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to