mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge pull request #20 from int2001/onelogfile
Use ONE Logfile instead of daily ones
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user