diff --git a/app/Http/Controllers/Admin/ConfigController.php b/app/Http/Controllers/Admin/ConfigController.php index c9031828..789ffc0a 100755 --- a/app/Http/Controllers/Admin/ConfigController.php +++ b/app/Http/Controllers/Admin/ConfigController.php @@ -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') diff --git a/app/Http/Requests/Admin/ConfigSave.php b/app/Http/Requests/Admin/ConfigSave.php index 4b5be2e1..b5ffe828 100755 --- a/app/Http/Requests/Admin/ConfigSave.php +++ b/app/Http/Requests/Admin/ConfigSave.php @@ -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', diff --git a/app/Services/ServerService.php b/app/Services/ServerService.php index de1fda89..fe839c81 100644 --- a/app/Services/ServerService.php +++ b/app/Services/ServerService.php @@ -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;