Skip to content

Commit

Permalink
fix: default json-file log size to 100MB
Browse files Browse the repository at this point in the history
Signed-off-by: Arjun Raja Yogidas <[email protected]>
  • Loading branch information
coderbirju committed Nov 13, 2024
1 parent 4a562dc commit 75c4c88
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/logging/json_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 75c4c88

Please sign in to comment.