diff --git a/config/log.yml b/config/log.yml index 1f5641622..2194d8917 100644 --- a/config/log.yml +++ b/config/log.yml @@ -2,14 +2,8 @@ storageLocation: ../../../../logs/ # Log rotation period (in hours), default is acceptable rotationTime: 24 -# Maximum size of each log file (in MB), default is acceptable, it means unlimited -maxSize: 0 -# Number of log files to retain, default is acceptable, it means whenever the log file is rotated, the old log file will be deleted -maxBackups: 10 -# Old log retain time (in days), default is acceptable, it means unlimited -maxAge: 10 -# Whether compress old log files. -compress: false +# Number of log files to retain, default is acceptable +remainRotationCount: 2 # Log level settings: 3 for production environment; 6 for more verbose logging in debugging environments remainLogLevel: 6 # Whether to output to standard output, default is acceptable diff --git a/pkg/common/cmd/root.go b/pkg/common/cmd/root.go index f4fcf680b..08bb6d064 100644 --- a/pkg/common/cmd/root.go +++ b/pkg/common/cmd/root.go @@ -136,11 +136,8 @@ func (r *RootCmd) initializeLogger(cmdOpts *CmdOpts) error { r.log.IsStdout, r.log.IsJson, r.log.StorageLocation, + r.log.RemainRotationCount, r.log.RotationTime, - r.log.MaxBackups, - r.log.MaxSize, - r.log.MaxAge, - r.log.Compress, config.Version, ) if err != nil { diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 6d9c9cc5d..f018c7b83 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -19,9 +19,9 @@ import ( "github.com/openimsdk/tools/db/redisutil" "github.com/openimsdk/tools/mq/kafka" "github.com/openimsdk/tools/s3/cos" + "github.com/openimsdk/tools/s3/kodo" "github.com/openimsdk/tools/s3/minio" "github.com/openimsdk/tools/s3/oss" - "github.com/openimsdk/tools/s3/kodo" "strings" "time" ) @@ -42,16 +42,13 @@ type LocalCache struct { } type Log struct { - StorageLocation string `mapstructure:"storageLocation"` - RotationTime uint `mapstructure:"rotationTime"` - RemainLogLevel int `mapstructure:"remainLogLevel"` - MaxSize int `mapstructure:"maxSize"` - MaxBackups int `mapstructure:"maxBackups"` - MaxAge int `mapstructure:"maxAge"` - Compress bool `mapstructure:"compress"` - IsStdout bool `mapstructure:"isStdout"` - IsJson bool `mapstructure:"isJson"` - WithStack bool `mapstructure:"withStack"` + StorageLocation string `mapstructure:"storageLocation"` + RotationTime uint `mapstructure:"rotationTime"` + RemainRotationCount uint `mapstructure:"remainRotationCount"` + RemainLogLevel int `mapstructure:"remainLogLevel"` + IsStdout bool `mapstructure:"isStdout"` + IsJson bool `mapstructure:"isJson"` + WithStack bool `mapstructure:"withStack"` } type Minio struct { @@ -284,7 +281,7 @@ type Third struct { Cos Cos `mapstructure:"cos"` Oss Oss `mapstructure:"oss"` Kodo Kodo `mapstructure:"kodo"` - Aws struct { + Aws struct { Endpoint string `mapstructure:"endpoint"` Region string `mapstructure:"region"` Bucket string `mapstructure:"bucket"`