I'm trying to write to my log file using this code in my class:
PHP Code:
function writeLog($str) { $h = fopen($this->logFile, 'a'); fwrite($h, date("D M j G:i:s T Y") . ' ' . $str . PHP_EOL); fclose($h); }
It works all well and good, but calling this function writes the string to the log file at least 3 times, every time! I have verified this function is getting called exactly 1 time.
Ex:
$Flickr->writeLog('Generating Image');
Gives me this in my log file:
Thu Jan 15 8:48:59 PST 2009 Generating Image
Thu Jan 15 8:49:01 PST 2009 Generating Image
Thu Jan 15 8:49:01 PST 2009 Generating Image
Anyone have any ideas why this is happening?
|