diff --git a/pkg/logging/json_logger.go b/pkg/logging/json_logger.go index 5c38bdd1492..73be699bb67 100644 --- a/pkg/logging/json_logger.go +++ b/pkg/logging/json_logger.go @@ -88,10 +88,9 @@ func (jsonLogger *JSONLogger) PreProcess(dataStore string, config *logging.Confi l := &logrotate.Logger{ Filename: jsonFilePath, } - //maxSize Defaults to unlimited. - var capVal int64 - capVal = -1 + //maxSize Defaults to 100MB. if capacity, ok := jsonLogger.Opts[MaxSize]; ok { + var capVal int64 var err error capVal, err = units.FromHumanSize(capacity) if err != nil { @@ -100,8 +99,8 @@ func (jsonLogger *JSONLogger) PreProcess(dataStore string, config *logging.Confi if capVal <= 0 { return fmt.Errorf("max-size must be a positive number") } + l.MaxBytes = capVal } - l.MaxBytes = capVal maxFile := 1 if maxFileString, ok := jsonLogger.Opts[MaxFile]; ok { var err error