Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: update the doc of the --log_rotate_max_age #50662

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/log/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ type Options struct {
ErrorOutputPaths []string

// RotateOutputPath is the path to a rotating log file. This file should
// be automatically rotated over time, based on the rotation parameters such
// as RotationMaxSize and RotationMaxAge. The default is to not rotate.
// be automatically rotated over time, based on the rotation parameter:
// RotationMaxSize.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why delete RotationMaxAge?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RotationMaxAge does not affect file rotation, just affect file backups instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any more questions? cc @hzxuzhonghu

The comments is wrong, according to lumberjack:

// MaxAge is the maximum number of days to retain old log files based on the
// timestamp encoded in their filename

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Donot we call storeing logs with timestamp as rotation? I think this is also a kind of rotation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, seems make sense too, just reverted it.

//
// This path is used as a foundational path. This is where log output is normally
// saved. When a rotation needs to take place because the file got too big or too
// old, then the file is renamed by appending a timestamp to the name. Such renamed
// saved. When a rotation needs to take place because the file got too big,
// then the file is renamed by appending a timestamp to the name. Such renamed
// files are called backups. Once a backup has been created,
// output resumes to this path.
RotateOutputPath string
Expand Down Expand Up @@ -244,7 +244,7 @@ func (o *Options) AttachFlags(
"The path for the optional rotating log file")

intVar(&o.RotationMaxAge, "log_rotate_max_age", o.RotationMaxAge,
"The maximum age in days of a log file beyond which the file is rotated (0 indicates no limit)")
"The maximum age in days of log file backups to keep before older files are deleted (0 indicates no limit)")

intVar(&o.RotationMaxSize, "log_rotate_max_size", o.RotationMaxSize,
"The maximum size in megabytes of a log file beyond which the file is rotated")
Expand Down