Skip to content

Improve the log for agent start & shutdown #352

Open

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)
	})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions