Posted By

suibhne on 07/31/09


Tagged

php logging


Versions (?)

Who likes this?

6 people have marked this snippet as a favorite

jealousy
irishsk
umang_nine
huynguye
joethermal
dimispaceman


PHP Log to Text File


 / Published in: PHP
 

Just simple logging to a text file for so many reasons.

  1. function doLog($text)
  2. {
  3. // open log file
  4. $filename = "form_ipn.log";
  5. $fh = fopen($filename, "a") or die("Could not open log file.");
  6. fwrite($fh, date("d-m-Y, H:i")." - $text\n") or die("Could not write file!");
  7. fclose($fh);
  8. }

Report this snippet  

You need to login to post a comment.