From 667f48fbf27e805a522011c6c84fab672b5ea659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Thu, 29 Jul 2021 15:57:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.Dns/SystemDnsUtil.cs | 5 +++-- FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs | 4 ++-- FastGithub/HostedService.cs | 2 +- FastGithub/appsettings.json | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/FastGithub.Dns/SystemDnsUtil.cs b/FastGithub.Dns/SystemDnsUtil.cs index fa8aa5b..b6dad63 100644 --- a/FastGithub.Dns/SystemDnsUtil.cs +++ b/FastGithub.Dns/SystemDnsUtil.cs @@ -1,4 +1,5 @@ -using System; +using FastGithub.Configuration; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -50,7 +51,7 @@ namespace FastGithub.Dns .Where(item => item.GetIPProperties().GetIPv4Properties().Index == dwBestIfIndex) .FirstOrDefault(); - return @interface ?? throw new NotSupportedException("找不到网络适配器用来设置dns"); + return @interface ?? throw new FastGithubException("找不到网络适配器用来设置dns"); } diff --git a/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs b/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs index 213daa9..87fbec0 100644 --- a/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs +++ b/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs @@ -43,7 +43,7 @@ namespace FastGithub if (CanTcpListen(HTTP_PORT) == false) { - logger.LogWarning($"无法监听tcp端口{HTTP_PORT},{nameof(FastGithub)}无法http反向代理"); + logger.LogError($"由于tcp端口{HTTP_PORT}已经被其它进程占用,{nameof(FastGithub)}无法进行http反向代理"); } else { @@ -76,7 +76,7 @@ namespace FastGithub if (CanTcpListen(HTTPS_PORT) == false) { - logger.LogWarning($"无法监听tcp端口{HTTPS_PORT},{nameof(FastGithub)}无法https反向代理"); + logger.LogError($"由于tcp端口{HTTPS_PORT}已经被其它进程占用,{nameof(FastGithub)}无法进行https反向代理"); } else { diff --git a/FastGithub/HostedService.cs b/FastGithub/HostedService.cs index 8d1bd99..673c4e1 100644 --- a/FastGithub/HostedService.cs +++ b/FastGithub/HostedService.cs @@ -29,7 +29,7 @@ namespace FastGithub /// public Task StartAsync(CancellationToken cancellationToken) { - this.logger.LogInformation($"{nameof(FastGithub)}启动完成,访问http://127.0.0.1或本机其它任意ip可进入Dashboard"); + this.logger.LogInformation($"{nameof(FastGithub)}启动完成,访问 http://127.0.0.1 或本机其它任意ip可进入Dashboard"); return Task.CompletedTask; } diff --git a/FastGithub/appsettings.json b/FastGithub/appsettings.json index 37ccbc1..c108d5b 100644 --- a/FastGithub/appsettings.json +++ b/FastGithub/appsettings.json @@ -30,7 +30,7 @@ "Yarp": "Warning", "System": "Warning", "Microsoft": "Warning", - "Microsoft.AspNetCore.Server.Kestrel": "Error" + "Microsoft.AspNetCore.Server.Kestrel": "None" } } }