Use logging options consistently for all components #967 (#968)

This commit is contained in:
Jack Neely 2017-09-02 05:24:11 -04:00 committed by stuart nelson
parent a5b2e0bbcc
commit 0dfdda3074

View File

@ -114,8 +114,6 @@ func main() {
log.Fatal(err)
}
logger := log.NewLogger(os.Stderr)
var mrouter *mesh.Router
if *meshListen != "" {
mrouter, err = initMesh(*meshListen, *hwaddr, *nickname, *password, log.With("component", "mesh"))
@ -133,7 +131,7 @@ func main() {
nflog.WithSnapshot(filepath.Join(*dataDir, "nflog")),
nflog.WithMaintenance(15*time.Minute, stopc, wg.Done),
nflog.WithMetrics(prometheus.DefaultRegisterer),
nflog.WithLogger(logger.With("component", "nflog")),
nflog.WithLogger(log.Base().With("component", "nflog")),
}
if *meshListen != "" {
notificationLogOpts = append(notificationLogOpts, nflog.WithMesh(func(g mesh.Gossiper) mesh.Gossip {
@ -154,7 +152,7 @@ func main() {
silenceOpts := silence.Options{
SnapshotFile: filepath.Join(*dataDir, "silences"),
Retention: *retention,
Logger: logger.With("component", "silences"),
Logger: log.Base().With("component", "silences"),
Metrics: prometheus.DefaultRegisterer,
}
if *meshListen != "" {