This commit is contained in:
berlin2123 2025-03-05 19:22:46 +08:00 committed by GitHub
parent 2d6712aed2
commit 6e07fc7d23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -241,7 +241,7 @@ func RegisterServerConfigFlags(cmd *cobra.Command, c *v1.ServerConfig, opts ...R
cmd.PersistentFlags().StringVarP(&c.Log.Level, "log_level", "", "info", "log level")
cmd.PersistentFlags().Int64VarP(&c.Log.MaxDays, "log_max_days", "", 3, "log max days")
cmd.PersistentFlags().BoolVarP(&c.Log.DisablePrintColor, "disable_log_color", "", false, "disable log color in console")
cmd.PersistentFlags().StringVarP(&c.Log.DurationTypes, "log_duration_types", "", "ssh,rdp", "log duration types")
cmd.PersistentFlags().StringVarP(&c.Log.DurationTypes, "log_duration_types", "", "", "log duration types")
cmd.PersistentFlags().StringVarP(&c.Auth.Token, "token", "t", "", "auth token")
cmd.PersistentFlags().StringVarP(&c.SubDomainHost, "subdomain_host", "", "", "subdomain host")
cmd.PersistentFlags().VarP(&PortsRangeSliceFlag{V: &c.AllowPorts}, "allow_ports", "", "allow ports")

View File

@ -293,7 +293,7 @@ func IsTheTypeToLog(logDurationTypes string, name string, xl *xlog.Logger) bool
}
thestrlist := strings.Split(logDurationTypes, ",")
for i := 0; i < len(thestrlist); i++ {
if (thestrlist[i]!="") && strings.Contains(name, thestrlist[i]) {
if (thestrlist[i] != "") && strings.Contains(name, thestrlist[i]) {
xl.Infof("The duration of each connection through this Proxy will be logged.")
return true
}