Skip to content

Instantly share code, notes, and snippets.

@eftakhairul
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eftakhairul/046224f410d8ee424eda to your computer and use it in GitHub Desktop.
Save eftakhairul/046224f410d8ee424eda to your computer and use it in GitHub Desktop.
This is a simple logger written by me
function doLog($text, $path = null)
{
// open log file
$logFileName = empty($path)? "/system_log.text" : $path . "/system_log.text";
$logger = fopen($logFileName, "a") or die("Could not open log file.");
//Write the given test with time
fwrite($logger, date("d-m-Y, H:i")." - $text\n") or die("Could not write file!");
fclose($logger);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment