From b002dce73751f6c411146772261f0092ecee90fb Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 24 Jan 2024 07:05:56 +0000 Subject: [PATCH] Make Logtype (daily / one file) configurable --- system/core/Log.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/system/core/Log.php b/system/core/Log.php index 8b2b22ba5..7c722c496 100644 --- a/system/core/Log.php +++ b/system/core/Log.php @@ -184,9 +184,12 @@ class CI_Log { return FALSE; } - # Changed to ONE File (you could use Logrotate) instead of daily files # $filepath = $this->_log_path.'log-'.date('Y-m-d').'.'.$this->_file_ext; $config =& get_config(); - $filepath = $this->_log_path.'log-'.str_replace(array("http://","https://","/"),"",$config['base_url']).'.'.$this->_file_ext; + if ((isset($config['one_log'])) && ($config['one_log'])) { + $filepath = $this->_log_path.'log-'.str_replace(array("http://","https://","/"),"",$config['base_url']).'.'.$this->_file_ext; + } else { + $filepath = $this->_log_path.'log-'.date('Y-m-d').'.'.$this->_file_ext; + } $message = ''; if ( ! file_exists($filepath))