You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Parameter log-file-path does not take effect
To Reproduce manager --log-file-path=/export/logs/vela.log ...
You will find that the log has been output to the console, and the log has not been created and output to the file /export/logs/vela.log
Expected behavior
Log parameters such as log-file-path, log-file-max-size, log-debug can take effect normally
Screenshots
KubeVela Version
1.9.2
Cluster information
1.19
Additional context
Troubleshooting reasons:
func (s *CoreOptions) Flags() cliflag.NamedFlagSets {
fss := cliflag.NamedFlagSets{}
gfs := fss.FlagSet("generic")
gfs.StringVar(&s.LogFilePath, "log-file-path", s.LogFilePath, "The file to write logs to.")
gfs.Uint64Var(&s.LogFileMaxSize, "log-file-max-size", s.LogFileMaxSize, "Defines the maximum size a log file can grow to, Unit is megabytes.")
gfs.BoolVar(&s.LogDebug, "log-debug", s.LogDebug, "Enable debug logs for development purpose")
kfs := fss.FlagSet("klog")
utillog.AddFlags(kfs)
if s.LogDebug {
_ = kfs.Set("v", strconv.Itoa(int(commonconfig.LogDebug)))
}
if s.LogFilePath != "" {
_ = kfs.Set("logtostderr", "false")
_ = kfs.Set("log_file", s.LogFilePath)
_ = kfs.Set("log_file_max_size", strconv.FormatUint(s.LogFileMaxSize, 10))
}
}
As implemented above, in the Flags configuration phase, s.LogFilePath must be the default empty string. Therefore, the log configuration will not take effect in klog.
Solution:
Log configuration and flush moved to run function
The text was updated successfully, but these errors were encountered:
Describe the bug
Parameter
log-file-path
does not take effectTo Reproduce
manager --log-file-path=/export/logs/vela.log ...
You will find that the log has been output to the console, and the log has not been created and output to the file
/export/logs/vela.log
Expected behavior
Log parameters such as
log-file-path
,log-file-max-size
,log-debug
can take effect normallyScreenshots
KubeVela Version
1.9.2
Cluster information
1.19
Additional context
Troubleshooting reasons:
As implemented above, in the Flags configuration phase,
s.LogFilePath
must be the default empty string. Therefore, the log configuration will not take effect inklog
.Solution:
Log configuration and flush moved to
run
functionThe text was updated successfully, but these errors were encountered: