rename logger & audit config (#591)

This commit is contained in:
Doug Lauder 2021-06-18 10:01:36 -04:00 committed by GitHub
parent d5096379de
commit ddfae3266a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 13 deletions

View file

@ -19,6 +19,6 @@
"enableLocalMode": true,
"localModeSocketLocation": "/var/tmp/focalboard_local.socket",
"authMode": "native",
"logging_file": "",
"audit_file": ""
"logging_cfg_file": "",
"audit_cfg_file": ""
}

View file

@ -58,7 +58,7 @@ func getTestConfig() *config.Configuration {
WebPath: "./pack",
FilesDriver: "local",
FilesPath: "./files",
LoggingJSON: logging,
LoggingCfgJSON: logging,
}
}
@ -66,7 +66,7 @@ func SetupTestHelper() *TestHelper {
sessionToken := "TESTTOKEN"
th := &TestHelper{}
logger := mlog.NewLogger()
logger.Configure("", getTestConfig().LoggingJSON)
logger.Configure("", getTestConfig().LoggingCfgJSON)
srv, err := server.New(getTestConfig(), sessionToken, logger)
if err != nil {
panic(err)

View file

@ -95,12 +95,12 @@ func main() {
}
logger := mlog.NewLogger()
cfgJSON := config.LoggingJSON
if config.LoggingFile == "" && cfgJSON == "" {
cfgJSON := config.LoggingCfgJSON
if config.LoggingCfgFile == "" && cfgJSON == "" {
// if no logging defined, use default config (console output)
cfgJSON = defaultLoggingConfig()
}
err = logger.Configure(config.LoggingFile, cfgJSON)
err = logger.Configure(config.LoggingCfgFile, cfgJSON)
if err != nil {
log.Fatal("Error in config file for logger: ", err)
return
@ -211,7 +211,7 @@ func startServer(webPath string, filesPath string, port int, singleUserToken, db
}
logger := mlog.NewLogger()
err = logger.Configure(config.LoggingFile, config.LoggingJSON)
err = logger.Configure(config.LoggingCfgFile, config.LoggingCfgJSON)
if err != nil {
log.Fatal("Error in config file for logger: ", err)
return

View file

@ -120,7 +120,7 @@ func New(cfg *config.Configuration, singleUserToken string, logger *mlog.Logger)
// Init audit
auditService := audit.NewAudit()
if err := auditService.Configure(cfg.AuditFile, cfg.AuditJSON); err != nil {
if err := auditService.Configure(cfg.AuditCfgFile, cfg.AuditCfgJSON); err != nil {
return nil, errors.New("unable to initialize the audit service")
}

View file

@ -49,11 +49,11 @@ type Configuration struct {
AuthMode string `json:"authMode" mapstructure:"authMode"`
LoggingFile string `json:"logging_file" mapstructure:"logging_file"`
LoggingJSON string `json:"logging_json" mapstructure:"logging_json"`
LoggingCfgFile string `json:"logging_cfg_file" mapstructure:"logging_cfg_file"`
LoggingCfgJSON string `json:"logging_cfg_json" mapstructure:"logging_cfg_json"`
AuditFile string `json:"audit_file" mapstructure:"audit_file"`
AuditJSON string `json:"audit_json" mapstructure:"audit_json"`
AuditCfgFile string `json:"audit_cfg_file" mapstructure:"audit_cfg_file"`
AuditCfgJSON string `json:"audit_cfg_json" mapstructure:"audit_cfg_json"`
}
// ReadConfigFile read the configuration from the filesystem.