|
@@ -211,6 +211,19 @@ func LoadConfig(cConfig *csconfig.Config) error {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Configure logging
|
|
|
|
+ if err := types.SetDefaultLoggerConfig(cConfig.Common.LogMedia,
|
|
|
|
+ cConfig.Common.LogDir, *cConfig.Common.LogLevel,
|
|
|
|
+ cConfig.Common.LogMaxSize, cConfig.Common.LogMaxFiles,
|
|
|
|
+ cConfig.Common.LogMaxAge, cConfig.Common.CompressLogs,
|
|
|
|
+ cConfig.Common.ForceColorLogs); err != nil {
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if err := csconfig.LoadFeatureFlagsFile(cConfig, log.StandardLogger()); err != nil {
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+
|
|
if !flags.DisableAgent {
|
|
if !flags.DisableAgent {
|
|
if err := cConfig.LoadCrowdsec(); err != nil {
|
|
if err := cConfig.LoadCrowdsec(); err != nil {
|
|
return err
|
|
return err
|
|
@@ -256,15 +269,6 @@ func LoadConfig(cConfig *csconfig.Config) error {
|
|
cConfig.Common.Daemonize = false
|
|
cConfig.Common.Daemonize = false
|
|
}
|
|
}
|
|
|
|
|
|
- // Configure logging
|
|
|
|
- if err := types.SetDefaultLoggerConfig(cConfig.Common.LogMedia,
|
|
|
|
- cConfig.Common.LogDir, *cConfig.Common.LogLevel,
|
|
|
|
- cConfig.Common.LogMaxSize, cConfig.Common.LogMaxFiles,
|
|
|
|
- cConfig.Common.LogMaxAge, cConfig.Common.CompressLogs,
|
|
|
|
- cConfig.Common.ForceColorLogs); err != nil {
|
|
|
|
- return err
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// recap of the enabled feature flags, because logging
|
|
// recap of the enabled feature flags, because logging
|
|
// was not enabled when we set them from envvars
|
|
// was not enabled when we set them from envvars
|
|
if fflist := csconfig.ListFeatureFlags(); fflist != "" {
|
|
if fflist := csconfig.ListFeatureFlags(); fflist != "" {
|