Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions bootstrap/kubeadm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,11 @@ func main() {
os.Exit(1)
}

// The JSON log format requires the Klog format in klog, otherwise log lines
// are serialized twice, e.g.:
// { ... "msg":"controller/cluster \"msg\"=\"Starting workers\"\n"}
if logOptions.Config.Format == logs.JSONLogFormat {
ctrl.SetLogger(klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog)))
} else {
ctrl.SetLogger(klogr.New())
}
// Set the Klog format, as the Serialize format shouldn't be used anymore.
// This makes sure that the logs are formatted correctly, i.e.:
// * JSON logging format: msg isn't serialized twice
// * text logging format: values are formatted with their .String() func.
ctrl.SetLogger(klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog)))

if profilerAddress != "" {
klog.Infof("Profiler listening for requests at %s", profilerAddress)
Expand Down
13 changes: 5 additions & 8 deletions controlplane/kubeadm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,11 @@ func main() {
os.Exit(1)
}

// The JSON log format requires the Klog format in klog, otherwise log lines
// are serialized twice, e.g.:
// { ... "msg":"controller/cluster \"msg\"=\"Starting workers\"\n"}
if logOptions.Config.Format == logs.JSONLogFormat {
ctrl.SetLogger(klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog)))
} else {
ctrl.SetLogger(klogr.New())
}
// Set the Klog format, as the Serialize format shouldn't be used anymore.
// This makes sure that the logs are formatted correctly, i.e.:
// * JSON logging format: msg isn't serialized twice
// * text logging format: values are formatted with their .String() func.
ctrl.SetLogger(klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog)))

if profilerAddress != "" {
klog.Infof("Profiler listening for requests at %s", profilerAddress)
Expand Down
13 changes: 5 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,11 @@ func main() {
os.Exit(1)
}

// The JSON log format requires the Klog format in klog, otherwise log lines
// are serialized twice, e.g.:
// { ... "msg":"controller/cluster \"msg\"=\"Starting workers\"\n"}
if logOptions.Config.Format == logs.JSONLogFormat {
ctrl.SetLogger(klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog)))
} else {
ctrl.SetLogger(klogr.New())
}
// Set the Klog format, as the Serialize format shouldn't be used anymore.
// This makes sure that the logs are formatted correctly, i.e.:
// * JSON logging format: msg isn't serialized twice
// * text logging format: values are formatted with their .String() func.
ctrl.SetLogger(klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog)))

if profilerAddress != "" {
klog.Infof("Profiler listening for requests at %s", profilerAddress)
Expand Down
13 changes: 5 additions & 8 deletions test/infrastructure/docker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,11 @@ func main() {
os.Exit(1)
}

// The JSON log format requires the Klog format in klog, otherwise log lines
// are serialized twice, e.g.:
// { ... "msg":"controller/cluster \"msg\"=\"Starting workers\"\n"}
if logOptions.Config.Format == logs.JSONLogFormat {
ctrl.SetLogger(klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog)))
} else {
ctrl.SetLogger(klogr.New())
}
// Set the Klog format, as the Serialize format shouldn't be used anymore.
// This makes sure that the logs are formatted correctly, i.e.:
// * JSON logging format: msg isn't serialized twice
// * text logging format: values are formatted with their .String() func.
ctrl.SetLogger(klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog)))

if profilerAddress != "" {
klog.Infof("Profiler listening for requests at %s", profilerAddress)
Expand Down