From aae91a45e27cb11e09b22bf9be04a7da9f6ff20b Mon Sep 17 00:00:00 2001 From: Chris Passas Date: Wed, 13 Feb 2013 11:51:30 -0500 Subject: Update system/core/Log.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated Log.php so that a developer can extend it and change the log file extension. It makes sense to default to .php when logs are in the public web folder.  It would be nice if a developer moves the log file path we have the option to use a standard extension like .log --- system/core/Log.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'system') diff --git a/system/core/Log.php b/system/core/Log.php index f5d091e14..3b0a9213d 100644 --- a/system/core/Log.php +++ b/system/core/Log.php @@ -71,6 +71,13 @@ class CI_Log { * @var string */ protected $_date_fmt = 'Y-m-d H:i:s'; + + /** + * Log file extension + * + * @var string + */ + protected $_log_ext = 'php'; /** * Whether or not the logger can write to the log files @@ -147,7 +154,7 @@ class CI_Log { return FALSE; } - $filepath = $this->_log_path.'log-'.date('Y-m-d').'.php'; + $filepath = $this->_log_path.'log-'.date('Y-m-d').'.'.$this->_log_ext; $message = ''; if ( ! file_exists($filepath)) @@ -179,4 +186,4 @@ class CI_Log { } /* End of file Log.php */ -/* Location: ./system/core/Log.php */ \ No newline at end of file +/* Location: ./system/core/Log.php */ -- cgit v1.2.3-24-g4f1b