Make Logtype (daily / one file) configurable

This commit is contained in:
int2001
2024-01-24 07:05:56 +00:00
parent 166b8bf98d
commit b002dce737

View File

@@ -184,9 +184,12 @@ class CI_Log {
return FALSE; 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(); $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 = ''; $message = '';
if ( ! file_exists($filepath)) if ( ! file_exists($filepath))