Skip to content

Commit 12211d9

Browse files
committed
Fix logging group name in user daemon
Signed-off-by: Thomas Hallgren <thomas@tada.se>
1 parent a512fe6 commit 12211d9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/client/userd/daemon/service.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,16 @@ func internalRun(c context.Context, flags *pflag.FlagSet) error {
247247
}
248248
addrStr := addrFlag.Value.String()
249249

250-
name, _ := flags.GetString(nameFlag)
251-
c = clog.WithGroup(c, name)
252250
logFile := flags.Lookup(logfileFlag).Value.String()
253251
c, err = logging.InitContext(c, logFile, cfg.LogLevels().UserDaemon, logging.RotateDaily, true)
254252
if err != nil {
255253
return err
256254
}
257-
c = clog.WithGroup(c, client.UserDaemonName)
255+
name, _ := flags.GetString(nameFlag)
256+
if name == "" {
257+
name = client.UserDaemonName
258+
}
259+
c = clog.WithGroup(c, name)
258260

259261
c = docker.EnableClient(c)
260262

0 commit comments

Comments
 (0)