Created
March 18, 2012 19:47
-
-
Save tristar500/2080351 to your computer and use it in GitHub Desktop.
Log File Helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
// -------------------------------------------------------------------- | |
if ( ! function_exists('log_entry')) | |
{ | |
// adds the $message to $the_log | |
function log_entry($the_log, $message) | |
{ | |
$myPath = $_SERVER['DOCUMENT_ROOT'].'/system/logs/'; | |
$myFile = $myPath . $the_log . '.log'; | |
$fh = fopen($myFile, 'a'); | |
$logData = date('m/d/Y G:i:s') . ' - ' .$message . "\r\n"; | |
fwrite($fh,$logData); | |
fclose($fh); | |
return true; | |
} | |
} | |
/* End of file logs_helper.php */ | |
/* Location: ./application/helpers/logs_helper.php */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment