diff --git a/FastGithub.ReverseProxy/RequestLoggingMilldeware.cs b/FastGithub.ReverseProxy/RequestLoggingMilldeware.cs index 95cf4c1..afe4064 100644 --- a/FastGithub.ReverseProxy/RequestLoggingMilldeware.cs +++ b/FastGithub.ReverseProxy/RequestLoggingMilldeware.cs @@ -2,6 +2,7 @@ using Microsoft.Extensions.Logging; using System; using System.Diagnostics; +using System.Net; using System.Threading.Tasks; namespace FastGithub.ReverseProxy @@ -46,6 +47,12 @@ namespace FastGithub.ReverseProxy var response = context.Response; var message = $"{request.Method} {request.Scheme}://{request.Host}{request.Path} responded {response.StatusCode} in {stopwatch.Elapsed.TotalMilliseconds} ms"; + var client = context.Connection.RemoteIpAddress; + if (IPAddress.Loopback.Equals(client) == false) + { + message = $"{client} {message}"; + } + var exception = context.GetForwarderErrorFeature()?.Exception; if (exception == null) {