From ec25bdb9f915ead01f416cae5c8683e19ed31f46 Mon Sep 17 00:00:00 2001 From: Qi Date: Mon, 30 May 2022 17:14:09 +0800 Subject: [PATCH] Add destination address to debug log --- pkg/tcp/proxy.go | 2 +- pkg/udp/proxy.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/tcp/proxy.go b/pkg/tcp/proxy.go index 06dc2884a..038062c68 100644 --- a/pkg/tcp/proxy.go +++ b/pkg/tcp/proxy.go @@ -48,7 +48,7 @@ func NewProxy(address string, terminationDelay time.Duration, proxyProtocol *dyn // ServeTCP forwards the connection to a service. func (p *Proxy) ServeTCP(conn WriteCloser) { - log.WithoutContext().Debugf("Handling connection from %s", conn.RemoteAddr()) + log.WithoutContext().Debugf("Handling connection from %s to %s", conn.RemoteAddr(), p.address) // needed because of e.g. server.trackedConnection defer conn.Close() diff --git a/pkg/udp/proxy.go b/pkg/udp/proxy.go index a69aafd93..8ccbfda4b 100644 --- a/pkg/udp/proxy.go +++ b/pkg/udp/proxy.go @@ -20,7 +20,7 @@ func NewProxy(address string) (*Proxy, error) { // ServeUDP implements the Handler interface. func (p *Proxy) ServeUDP(conn *Conn) { - log.WithoutContext().Debugf("Handling connection from %s", conn.rAddr) + log.WithoutContext().Debugf("Handling connection from %s to %s", conn.rAddr, p.target) // needed because of e.g. server.trackedConnection defer conn.Close()