<?php
  function writeToLogFile($msg){
     $today = date("Y_m_d");
     $logfile = $today."_log_impexp.txt";
     $dir = 'logs';
     $saveLocation=$dir . '/' . $logfile;
     if  (!$handle = @fopen($saveLocation, "a")) {
          exit;
     } else {
          if (@fwrite($handle,"$msg\r\n") === FALSE) {
               exit;
          }
   
          @fclose($handle);
     }
  }
?>