Fix log destination in one-shot mode (#2084)

This commit is contained in:
mmetc 2023-03-01 17:00:04 +01:00 committed by GitHub
parent 83db873f5b
commit a6bb2cf5e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -1,2 +1,2 @@
[worker.oci]
max-parallelism = 2
# max-parallelism = 2

View file

@ -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)
}