mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2026-10-12 02:12:31 +00:00
Fix log destination in one-shot mode (#2084)
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
[worker.oci]
|
||||
max-parallelism = 2
|
||||
# max-parallelism = 2
|
||||
|
||||
@@ -211,6 +211,11 @@ func LoadConfig(cConfig *csconfig.Config) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if flags.SingleFileType != "" && flags.OneShotDSN != "" {
|
||||
// if we're in time-machine mode, we don't want to log to file
|
||||
cConfig.Common.LogMedia = "stdout"
|
||||
}
|
||||
|
||||
// Configure logging
|
||||
if err := types.SetDefaultLoggerConfig(cConfig.Common.LogMedia,
|
||||
cConfig.Common.LogDir, *cConfig.Common.LogLevel,
|
||||
@@ -264,7 +269,6 @@ func LoadConfig(cConfig *csconfig.Config) error {
|
||||
if flags.DisableAPI {
|
||||
cConfig.Common.Daemonize = false
|
||||
}
|
||||
cConfig.Common.LogMedia = "stdout"
|
||||
log.Infof("single file mode : log_media=%s daemonize=%t", cConfig.Common.LogMedia, cConfig.Common.Daemonize)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user