diff --git a/FastGithub.DomainResolve/DomainResolver.cs b/FastGithub.DomainResolve/DomainResolver.cs index fb629c3..754f222 100644 --- a/FastGithub.DomainResolve/DomainResolver.cs +++ b/FastGithub.DomainResolve/DomainResolver.cs @@ -72,7 +72,7 @@ namespace FastGithub.DomainResolve } catch (Exception) { - this.logger.LogTrace($"由于{pureDns}解析{domain}失败,本次使用{fastDns}"); + this.logger.LogWarning($"由于{pureDns}解析{domain}失败,本次使用{fastDns}"); return await LookupCoreAsync(fastDns, domain, cancellationToken); } } diff --git a/FastGithub.Http/HttpClient.cs b/FastGithub.Http/HttpClient.cs index 8db9f8c..064cf30 100644 --- a/FastGithub.Http/HttpClient.cs +++ b/FastGithub.Http/HttpClient.cs @@ -23,7 +23,6 @@ namespace FastGithub.Http public HttpClient(DomainConfig domainConfig, IDomainResolver domainResolver) : this(domainConfig, new HttpClientHandler(domainResolver), disposeHandler: true) { - this.domainConfig = domainConfig; } /// diff --git a/FastGithub.ReverseProxy/RequestLoggingMilldeware.cs b/FastGithub.ReverseProxy/RequestLoggingMilldeware.cs index afe4064..e838031 100644 --- a/FastGithub.ReverseProxy/RequestLoggingMilldeware.cs +++ b/FastGithub.ReverseProxy/RequestLoggingMilldeware.cs @@ -60,7 +60,7 @@ namespace FastGithub.ReverseProxy } else { - this.logger.LogError($"{message}{Environment.NewLine}{exception.Message}"); + this.logger.LogError($"{message}{Environment.NewLine}{exception}"); } } } diff --git a/FastGithub.ReverseProxy/ReverseProxyMiddleware.cs b/FastGithub.ReverseProxy/ReverseProxyMiddleware.cs index 73d67cd..b0c451c 100644 --- a/FastGithub.ReverseProxy/ReverseProxyMiddleware.cs +++ b/FastGithub.ReverseProxy/ReverseProxyMiddleware.cs @@ -105,7 +105,7 @@ namespace FastGithub.ReverseProxy await context.Response.WriteAsJsonAsync(new { error = error.ToString(), - message = errorFeature.Exception?.ToString() + message = errorFeature.Exception?.Message }); } } diff --git a/FastGithub/Program.cs b/FastGithub/Program.cs index 6a455f6..89da123 100644 --- a/FastGithub/Program.cs +++ b/FastGithub/Program.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; +using System; using System.IO; namespace FastGithub @@ -41,6 +42,7 @@ namespace FastGithub .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); + webBuilder.UseShutdownTimeout(TimeSpan.FromSeconds(2d)); webBuilder.UseKestrel(kestrel => { kestrel.ListenHttpReverseProxy(); diff --git a/FastGithub/appsettings.json b/FastGithub/appsettings.json index c108d5b..37ccbc1 100644 --- a/FastGithub/appsettings.json +++ b/FastGithub/appsettings.json @@ -30,7 +30,7 @@ "Yarp": "Warning", "System": "Warning", "Microsoft": "Warning", - "Microsoft.AspNetCore.Server.Kestrel": "None" + "Microsoft.AspNetCore.Server.Kestrel": "Error" } } }