diff --git a/application/config/config.sample.php b/application/config/config.sample.php index 18c67e9c7..e3415191b 100644 --- a/application/config/config.sample.php +++ b/application/config/config.sample.php @@ -364,6 +364,19 @@ $config['log_threshold'] = 0; */ $config['log_path'] = ''; +/* +|-------------------------------------------------------------------------- +| One Logfile (true) or daily logfile? +|-------------------------------------------------------------------------- +| +| Leave this setted to false unless you would like to have one big logfile +| at application/logs/ directory. +| +| true == one big log +| false (or non-existant): daily logs +*/ +$config['one_log'] = false; + /* |-------------------------------------------------------------------------- | Log File Extension diff --git a/system/core/Log.php b/system/core/Log.php index 36634c159..7c722c496 100644 --- a/system/core/Log.php +++ b/system/core/Log.php @@ -184,7 +184,12 @@ class CI_Log { return FALSE; } - $filepath = $this->_log_path.'log-'.date('Y-m-d').'.'.$this->_file_ext; + $config =& get_config(); + 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))