[promtail] log: simplify log, only print hash (#7405)

Compute and print MD5 hash of config
pull/7407/head
李国忠 3 years ago committed by GitHub
parent 46d3dec010
commit 61bbe15171
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      clients/pkg/promtail/promtail.go

@ -1,6 +1,7 @@
package promtail
import (
"crypto/md5"
"errors"
"fmt"
"os"
@ -119,7 +120,7 @@ func (p *Promtail) reloadConfig(cfg *config.Config) error {
return errConfigNotChange
}
newConf := cfg.String()
level.Info(p.logger).Log("msg", "Reloading configuration file", "newConf", newConf)
level.Info(p.logger).Log("msg", "Reloading configuration file", "newConf.hash", md5.New().Sum([]byte(newConf)))
if p.targetManagers != nil {
p.targetManagers.Stop()
}

Loading…
Cancel
Save