log at info level the service configurations

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-01-05 13:22:49 +01:00
parent 7c68b03d07
commit 0a3d94f73d
6 changed files with 14 additions and 14 deletions

View File

@@ -257,7 +257,7 @@ func (c *Configuration) ShouldBind() bool {
// Initialize configures and starts the FTP server // Initialize configures and starts the FTP server
func (c *Configuration) Initialize(configDir string) error { func (c *Configuration) Initialize(configDir string) error {
logger.Debug(logSender, "", "initializing FTP server with config %+v", *c) logger.Info(logSender, "", "initializing FTP server with config %+v", *c)
if !c.ShouldBind() { if !c.ShouldBind() {
return common.ErrNoBinding return common.ErrNoBinding
} }

View File

@@ -453,7 +453,7 @@ func (c *Conf) getRedacted() Conf {
// Initialize configures and starts the HTTP server // Initialize configures and starts the HTTP server
func (c *Conf) Initialize(configDir string) error { func (c *Conf) Initialize(configDir string) error {
logger.Debug(logSender, "", "initializing HTTP server with config %+v", c.getRedacted()) logger.Info(logSender, "", "initializing HTTP server with config %+v", c.getRedacted())
backupsPath = getConfigPath(c.BackupsPath, configDir) backupsPath = getConfigPath(c.BackupsPath, configDir)
staticFilesPath := getConfigPath(c.StaticFilesPath, configDir) staticFilesPath := getConfigPath(c.StaticFilesPath, configDir)
templatesPath := getConfigPath(c.TemplatesPath, configDir) templatesPath := getConfigPath(c.TemplatesPath, configDir)

View File

@@ -444,8 +444,8 @@ func (s *Secret) TryDecrypt() error {
} }
func isSecretStatusValid(status string) bool { func isSecretStatusValid(status string) bool {
for i := 0; i < len(validSecretStatuses); i++ { for idx := range validSecretStatuses {
if validSecretStatuses[i] == status { if validSecretStatuses[idx] == status {
return true return true
} }
} }

View File

@@ -168,7 +168,7 @@ func (s *Service) startServices() {
go func() { go func() {
redactedConf := sftpdConf redactedConf := sftpdConf
redactedConf.KeyboardInteractiveHook = util.GetRedactedURL(sftpdConf.KeyboardInteractiveHook) redactedConf.KeyboardInteractiveHook = util.GetRedactedURL(sftpdConf.KeyboardInteractiveHook)
logger.Debug(logSender, "", "initializing SFTP server with config %+v", redactedConf) logger.Info(logSender, "", "initializing SFTP server with config %+v", redactedConf)
if err := sftpdConf.Initialize(s.ConfigDir); err != nil { if err := sftpdConf.Initialize(s.ConfigDir); err != nil {
logger.Error(logSender, "", "could not start SFTP server: %v", err) logger.Error(logSender, "", "could not start SFTP server: %v", err)
logger.ErrorToConsole("could not start SFTP server: %v", err) logger.ErrorToConsole("could not start SFTP server: %v", err)
@@ -177,7 +177,7 @@ func (s *Service) startServices() {
s.Shutdown <- true s.Shutdown <- true
}() }()
} else { } else {
logger.Debug(logSender, "", "SFTP server not started, disabled in config file") logger.Info(logSender, "", "SFTP server not started, disabled in config file")
} }
if httpdConf.ShouldBind() { if httpdConf.ShouldBind() {
@@ -190,9 +190,9 @@ func (s *Service) startServices() {
s.Shutdown <- true s.Shutdown <- true
}() }()
} else { } else {
logger.Debug(logSender, "", "HTTP server not started, disabled in config file") logger.Info(logSender, "", "HTTP server not started, disabled in config file")
if s.PortableMode != 1 { if s.PortableMode != 1 {
logger.DebugToConsole("HTTP server not started, disabled in config file") logger.InfoToConsole("HTTP server not started, disabled in config file")
} }
} }
if ftpdConf.ShouldBind() { if ftpdConf.ShouldBind() {
@@ -205,7 +205,7 @@ func (s *Service) startServices() {
s.Shutdown <- true s.Shutdown <- true
}() }()
} else { } else {
logger.Debug(logSender, "", "FTP server not started, disabled in config file") logger.Info(logSender, "", "FTP server not started, disabled in config file")
} }
if webDavDConf.ShouldBind() { if webDavDConf.ShouldBind() {
go func() { go func() {
@@ -217,7 +217,7 @@ func (s *Service) startServices() {
s.Shutdown <- true s.Shutdown <- true
}() }()
} else { } else {
logger.Debug(logSender, "", "WebDAV server not started, disabled in config file") logger.Info(logSender, "", "WebDAV server not started, disabled in config file")
} }
if telemetryConf.ShouldBind() { if telemetryConf.ShouldBind() {
go func() { go func() {
@@ -229,9 +229,9 @@ func (s *Service) startServices() {
s.Shutdown <- true s.Shutdown <- true
}() }()
} else { } else {
logger.Debug(logSender, "", "telemetry server not started, disabled in config file") logger.Info(logSender, "", "telemetry server not started, disabled in config file")
if s.PortableMode != 1 { if s.PortableMode != 1 {
logger.DebugToConsole("telemetry server not started, disabled in config file") logger.InfoToConsole("telemetry server not started, disabled in config file")
} }
} }
} }

View File

@@ -79,7 +79,7 @@ func (c Conf) ShouldBind() bool {
// Initialize configures and starts the telemetry server. // Initialize configures and starts the telemetry server.
func (c Conf) Initialize(configDir string) error { func (c Conf) Initialize(configDir string) error {
var err error var err error
logger.Debug(logSender, "", "initializing telemetry server with config %+v", c) logger.Info(logSender, "", "initializing telemetry server with config %+v", c)
authUserFile := getConfigPath(c.AuthUserFile, configDir) authUserFile := getConfigPath(c.AuthUserFile, configDir)
httpAuth, err = common.NewBasicAuthProvider(authUserFile) httpAuth, err = common.NewBasicAuthProvider(authUserFile)
if err != nil { if err != nil {

View File

@@ -158,7 +158,7 @@ func (c *Configuration) ShouldBind() bool {
// Initialize configures and starts the WebDAV server // Initialize configures and starts the WebDAV server
func (c *Configuration) Initialize(configDir string) error { func (c *Configuration) Initialize(configDir string) error {
logger.Debug(logSender, "", "initializing WebDAV server with config %+v", *c) logger.Info(logSender, "", "initializing WebDAV server with config %+v", *c)
mimeTypeCache = mimeCache{ mimeTypeCache = mimeCache{
maxSize: c.Cache.MimeTypes.MaxSize, maxSize: c.Cache.MimeTypes.MaxSize,
mimeTypes: make(map[string]string), mimeTypes: make(map[string]string),