Skip to content

Commit

Permalink
add "info" level log
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Apr 20, 2020
1 parent c70a652 commit 4650791
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
7 changes: 1 addition & 6 deletions pkg/middlewares/canary/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"net"
"net/http"
"net/url"
"os"
"runtime"
"sync/atomic"
"time"
Expand All @@ -22,11 +21,7 @@ import (
)

func init() {
hostname, _ := os.Hostname()
if hostname == "" {
hostname = "unknown"
}
userAgent = fmt.Sprintf("Go/%v Hostname/%s Traefik/%s (Canary Middleware)", runtime.Version(), hostname, version.Version)
userAgent = fmt.Sprintf("Go/%v Traefik/%s (Canary Middleware)", runtime.Version(), version.Version)
}

var userAgent string
Expand Down
1 change: 1 addition & 0 deletions pkg/provider/kubernetes/crd/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe.
case p.lastConfiguration.Get() == confHash:
logger.Debugf("Skipping Kubernetes event kind %T", event)
default:
logger.Infof("Process Kubernetes event %T, hash %d, conf %+v", event, confHash, conf)
p.lastConfiguration.Set(confHash)
configurationChan <- dynamic.Message{
ProviderName: providerName,
Expand Down
4 changes: 2 additions & 2 deletions pkg/server/service/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ func buildProxy(passHostHeader *bool, responseForwarding *dynamic.ResponseForwar
}
}

log.Debugf("'%d %s' caused by: %v", statusCode, statusText(statusCode), err)
log.Infof("'%d %s' caused by: %v", statusCode, statusText(statusCode), err)
w.WriteHeader(statusCode)
_, werr := w.Write([]byte(statusText(statusCode)))
if werr != nil {
log.Debugf("Error while writing status code", werr)
log.Infof("Error while writing status code", werr)
}
},
}
Expand Down

0 comments on commit 4650791

Please sign in to comment.