Skip to content

Commit 75c4c88

Browse files
committed
fix: default json-file log size to 100MB
Signed-off-by: Arjun Raja Yogidas <[email protected]>
1 parent 4a562dc commit 75c4c88

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pkg/logging/json_logger.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,9 @@ func (jsonLogger *JSONLogger) PreProcess(dataStore string, config *logging.Confi
8888
l := &logrotate.Logger{
8989
Filename: jsonFilePath,
9090
}
91-
//maxSize Defaults to unlimited.
92-
var capVal int64
93-
capVal = -1
91+
//maxSize Defaults to 100MB.
9492
if capacity, ok := jsonLogger.Opts[MaxSize]; ok {
93+
var capVal int64
9594
var err error
9695
capVal, err = units.FromHumanSize(capacity)
9796
if err != nil {
@@ -100,8 +99,8 @@ func (jsonLogger *JSONLogger) PreProcess(dataStore string, config *logging.Confi
10099
if capVal <= 0 {
101100
return fmt.Errorf("max-size must be a positive number")
102101
}
102+
l.MaxBytes = capVal
103103
}
104-
l.MaxBytes = capVal
105104
maxFile := 1
106105
if maxFileString, ok := jsonLogger.Opts[MaxFile]; ok {
107106
var err error

0 commit comments

Comments
 (0)