mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
log path support env specific
This commit is contained in:
@@ -229,8 +229,14 @@ function getLogFile()
|
||||
return $logFile;
|
||||
}
|
||||
$config = nexus_config('nexus');
|
||||
$logFile = sys_get_temp_dir() . '/nexus_' . date('Y-m-d') . '.log';
|
||||
if (!empty($config['log_file'])) {
|
||||
$path = getenv('NEXUS_LOG_DIR', true);
|
||||
$fromEnv = true;
|
||||
if ($path === false) {
|
||||
$fromEnv = false;
|
||||
$path = sys_get_temp_dir();
|
||||
}
|
||||
$logFile = rtrim($path, '/') . '/nexus_' . date('Y-m-d') . '.log';
|
||||
if (!$fromEnv && !empty($config['log_file'])) {
|
||||
$logFile = $config['log_file'];
|
||||
}
|
||||
$lastDotPos = strrpos($logFile, '.');
|
||||
|
||||
Reference in New Issue
Block a user