Skip to content

Commit

Permalink
Lower logs verbosity
Browse files Browse the repository at this point in the history
- Running multiple Tyk group in same Redis is a normal setup (while not
very common). In this case DRL will receive messages from different
groups, and will ignore them.
- RPC analytics purger can fail in case of MDCB auto-scaling events or
session timeout. Should not be error log.

Additionally fixed setting log level though tyk config. It was setting
log level only for `mainLog` which used only for initialization.
  • Loading branch information
buger committed May 19, 2018
1 parent a425019 commit 31bd9d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion distributed_rate_limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func onServerStatusReceivedHandler(payload string) {
if err := DRLManager.AddOrUpdateServer(serverData); err != nil {
log.WithError(err).
WithField("serverData", serverData).
Error("AddOrUpdateServer error")
Debug("AddOrUpdateServer error. Seems like you running multiple segmented Tyk groups in same Redis.")
return
}
log.Debug(DRLManager.Report())
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -827,11 +827,11 @@ func initialiseSystem() error {
case "", "info":
// default, do nothing
case "error":
mainLog.Level = logrus.ErrorLevel
log.Level = logrus.ErrorLevel
case "warn":
mainLog.Level = logrus.WarnLevel
log.Level = logrus.WarnLevel
case "debug":
mainLog.Level = logrus.DebugLevel
log.Level = logrus.DebugLevel
default:
mainLog.Fatalf("Invalid log level %q specified in config, must be error, warn, debug or info. ", level)
}
Expand Down
2 changes: 1 addition & 1 deletion rpc_analytics_purger.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (r *RPCPurger) PurgeCache() {
// Send keys to RPC
if _, err := RPCFuncClientSingleton.Call("PurgeAnalyticsData", string(data)); err != nil {
emitRPCErrorEvent(rpcFuncClientSingletonCall, "PurgeAnalyticsData", err)
log.Error("Failed to call purge: ", err)
log.Warn("Failed to call purge, retrying: ", err)
}

}
Expand Down

0 comments on commit 31bd9d7

Please sign in to comment.