Thursday, 20 January 2011

/php/ debug script where logs debug info appending a file

description: quick code to log activities...

solution:
$file = fopen("dn_debug_log.txt", "a+");
fwrite($file,$queryscript."\n\n");
fclose($file);

note: the file is created in the directory of the called php any not in the directory of the php where contains the code! That means that if you place the code in a library that is called from another php script, the file will be created in the directory of the calling php and not of the library.


important note: do not leave this code active because then log will never stop growing!

No comments:

Post a Comment