Skip to content

Commit

Permalink
gs: Fix log namespace and increase log level for failed connects
Browse files Browse the repository at this point in the history
  • Loading branch information
johanstokking committed Aug 23, 2024
1 parent e4dadd7 commit f5bb47e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/gatewayserver/io/ttigw/ttigw.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ var _ io.Frontend = (*Frontend)(nil)

// New returns a new The Things Industries V1 gateway frontend.
func New(ctx context.Context, server io.Server, cfg Config) (*Frontend, error) {
ctx = log.NewContextWithField(ctx, "namespace", "gatewayserver/io/ttigw")

var proxyConfiguration webmiddleware.ProxyConfiguration
if err := proxyConfiguration.ParseAndAddTrusted(server.GetBaseConfig(ctx).HTTP.TrustedProxies...); err != nil {
return nil, err
Expand Down Expand Up @@ -130,7 +132,7 @@ func (f *Frontend) handleGet(w http.ResponseWriter, r *http.Request) {
}
ctx, ids, err := f.authenticate(ctx, cert)
if err != nil {
logger.WithError(err).Debug("Client certificate verification failed")
logger.WithError(err).Warn("Client certificate verification failed")
writeError(w, err)
return
}
Expand All @@ -140,7 +142,7 @@ func (f *Frontend) handleGet(w http.ResponseWriter, r *http.Request) {
Ip: remoteIP(r),
})
if err != nil {
logger.WithError(err).Info("Failed to connect")
logger.WithError(err).Warn("Failed to connect")
writeError(w, err)
return
}
Expand Down

0 comments on commit f5bb47e

Please sign in to comment.