Merge pull request #20 from int2001/onelogfile

Use ONE Logfile instead of daily ones
This commit is contained in:
Joerg (DJ7NT)
2024-01-24 13:25:18 +01:00
committed by GitHub
2 changed files with 19 additions and 1 deletions

View File

@@ -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

View File

@@ -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))