Add node address information to logs (#7941)

This commit is contained in:
Krishnan Parthasarathi
2019-07-18 09:58:37 -07:00
committed by Harshavardhana
parent be9baa1464
commit fbfc9a61ec
8 changed files with 18 additions and 23 deletions

View File

@@ -31,7 +31,6 @@ import (
"github.com/minio/minio/cmd/logger"
"github.com/minio/minio/pkg/auth"
"github.com/minio/minio/pkg/handlers"
xnet "github.com/minio/minio/pkg/net"
)
// Parses location constraint from the incoming reader.
@@ -387,15 +386,11 @@ func notFoundHandler(w http.ResponseWriter, r *http.Request) {
}
// gets host name for current node
func getHostName(r *http.Request) (hostName string, err error) {
var thisAddr *xnet.Host
hostName = r.Host
func getHostName(r *http.Request) (hostName string) {
if globalIsDistXL {
thisAddr, err = xnet.ParseHost(GetLocalPeer(globalEndpoints))
if err != nil {
return
}
hostName = thisAddr.String()
hostName = GetLocalPeer(globalEndpoints)
} else {
hostName = r.Host
}
return
}