mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
增加服务器IP记录,支持分步式部署日志管理
This commit is contained in:
@@ -38,6 +38,6 @@ class File {
|
||||
//检测日志文件大小,超过配置大小则备份日志文件重新生成
|
||||
if(is_file($destination) && floor($this->config['file_size']) <= filesize($destination) )
|
||||
rename($destination,dirname($destination).'/'.time().'-'.basename($destination));
|
||||
error_log("[{$now}] ".$_SERVER['REMOTE_ADDR'].' '.$_SERVER['REQUEST_URI']."\r\n{$log}\r\n", 3,$destination);
|
||||
error_log("[{$now}] {$_SERVER['SERVER_ADDR']} {$_SERVER['REMOTE_ADDR']} {$_SERVER['REQUEST_URI']}\r\n{$log}\r\n", 3,$destination);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class Sae {
|
||||
public function write($log,$destination='') {
|
||||
static $is_debug = null;
|
||||
$now = date($this->config['log_time_format']);
|
||||
$logstr = "[{$now}] ".$_SERVER['REMOTE_ADDR'].' '.$_SERVER['REQUEST_URI']."\r\n{$log}\r\n";
|
||||
$logstr = "[{$now}] {$_SERVER['SERVER_ADDR']} {$_SERVER['REMOTE_ADDR']} {$_SERVER['REQUEST_URI']}\r\n{$log}\r\n";
|
||||
if(is_null($is_debug)){
|
||||
preg_replace('@(\w+)\=([^;]*)@e', '$appSettings[\'\\1\']="\\2";', $_SERVER['HTTP_APPCOOKIE']);
|
||||
$is_debug = in_array($_SERVER['HTTP_APPVERSION'], explode(',', $appSettings['debug'])) ? true : false;
|
||||
|
||||
Reference in New Issue
Block a user