Azure / Azure/fleet

Improve the log for agent start & shutdown

Open
#352 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
226
Forks
44
Avg merge
11h 7m
Merged PRs (30d)
5

Description

The current log level for shutdown/starting hub/member managers is using v(3).

https://github.com/Azure/fleet/blob/main/cmd/memberagent/main.go#L220

In the production, it's not easy to tell whether the manager has been started/shutdown based on the agent log.
It's better to change the log level to 1.

https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#what-method-to-use

```
klog.V(1).InfoS - A reasonable default log level if you don't want verbosity.
Information about config (listening on X, watching Y)
Errors that repeat frequently that relate to conditions that can be corrected (pod detected as unhealthy)
```

It's better to print the flag value for the agent configurations and it could be helpful in the production.
similar to https://github.com/Azure/fleet-networking/blob/main/cmd/mcs-controller-manager/main.go#L83

```
flag.VisitAll(func(f *flag.Flag) {
klog.InfoS("flag:", "name", f.Name, "value", f.Value)
})
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.