// MaxSize is the maximum size of a log file in bytes.
// It is initialized from the --log_max_size_mb flag when the first log file is created.
varMaxSizeuint64=1024*1024*1800
// MaxFileCount is the maximum number of log files retained per severity level.
// It is initialized from the --log_max_files flag when the first log file is created.
varMaxFileCount=5
// logDirs lists the candidate directories for new log files.
@ -43,7 +47,25 @@ var logDirs []string
// See createLogDirs for the full list of possible destinations.
varlogDir=flag.String("logdir","","If non-empty, write log files in this directory")
// logMaxSizeMB controls the maximum size of each log file in megabytes.
// When a log file reaches this size it is closed and a new file is created.
// Defaults to 1800 MB. Set to 0 to use the compiled-in default.
varlogMaxSizeMB=flag.Uint64("log_max_size_mb",1800,"Maximum size in megabytes of each log file before it is rotated (0 = use default of 1800 MB)")
// logMaxFiles controls how many log files are kept per severity level.
// Older files are deleted when the limit is exceeded.
// Defaults to 5.
varlogMaxFiles=flag.Int("log_max_files",5,"Maximum number of log files to keep per severity level before older ones are deleted (0 = use default of 5)")
funccreateLogDirs(){
// Apply flag values now that flags have been parsed.