set log level in global

This commit is contained in:
Tokumeikoi 2020-05-30 14:43:18 +08:00
parent afc9b462e5
commit 53e1e41902
3 changed files with 4 additions and 1 deletions

View File

@ -98,7 +98,8 @@ class ConfigController extends Controller
],
'server' => [
'server_token' => config('v2board.server_token'),
'server_license' => config('v2board.server_license')
'server_license' => config('v2board.server_license'),
'server_log_level' => config('v2board.server_log_level', 'none')
],
'tutorial' => [
'apple_id' => config('v2board.apple_id')

View File

@ -35,6 +35,7 @@ class ConfigSave extends FormRequest
// server
'server_token' => 'nullable|min:16',
'server_license' => 'nullable',
'server_log_level' => 'nullable|in:debug,info,warning,error,none',
// alipay
'alipay_enable' => 'in:0,1',
'alipay_appid' => 'nullable|integer|min:16',

View File

@ -41,6 +41,7 @@ class ServerService
abort(500, '节点不存在');
}
$json = json_decode(self::SERVER_CONFIG);
$json->log->loglevel = config('v2board.server_log_level', 'none');
$json->inboundDetour[0]->port = (int)$localPort;
$json->inbound->port = (int)$server->server_port;
$json->inbound->streamSettings->network = $server->network;