http://nottsbushido.co.uk/hotstore/Hotsale-20150822-37342.html In every project we get a need to create log files. We can easily debug our code in production by using log files. So always try to put log files in each operation in your project.
Here I am posting a small script which you can use in any of your file or in constructor of class or in common config or function file to start creating log file.
go Add Log File In Temp (It should be at the starting of your code like: config file or common function file or if you want to add it for one page only then include the lines it in that page)
//start creating log file
$uploadDir = sys_get_temp_dir();
$now = new DateTime;
$now = $now->format('d-m-Y');
$filename = $uploadDir.DIRECTORY_SEPARATOR.$now.time().'__myprojectlog.txt';
$fileResource = fopen($filename, "a") or die("Could not open log file.");
edge dating wwe Now a log file will be created in tmp directory. In unix it is in the root of your server like /tmp.
http://euromessengers.org/?biodetd=bin%C3%A4re-optionen-call-put&4f3=a6 go to link Add Success/Error Logs in file
Now its time to add logs in your log file. Here is a small example to achieve this:
$fileErrorLog = "Error while uploading file:".$filePath;
fwrite($fileResource, date("d-m-Y, H:i:s")." - $fileErrorLog \n");
http://orpheum-nuernberg.de/?bioede=bin%C3%A4re-optionen-broker-zum-kopieren&65b=a4 That’s all. Now Check your temp directory for error log file. 🙂