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

Apply max_log_file constraint when timestamp_in_log_file=false #1089

Open
andrembcosta opened this issue Mar 19, 2024 · 2 comments · May be fixed by #1143
Open

Apply max_log_file constraint when timestamp_in_log_file=false #1089

andrembcosta opened this issue Mar 19, 2024 · 2 comments · May be fixed by #1143

Comments

@andrembcosta
Copy link

Currently, when the flag timestamp_in_log_file=false and max_log_file is set, instead of quitting logging or overwriting to preserve the size limit, glog just appends to the log file and eventually breaks the size limit.

Am I missing another flag to get the intended behavior of having a single log file of limited size? Or is this an actual limitation?

This appears to be similar to #809

@HNOONa-0
Copy link

HNOONa-0 commented Dec 15, 2024

Hello @drigz,

I’ve investigated this bug and understand why it occurs. I would like to work on fixing this issue
But let's assume that I restrict the file to 1 MiB and I have exceeded that limit, I have the following options:

  • Force timestamp_in_log_file to true. Note this can lead to duplication errors when file size constraint is too small (1 MiB)
  • Add an auto-incrementing index to LogFileObject and start writing to a new file named base_filename_.<index>
  • Truncate the current file once it exceeds the limit and start writing from the beginning

I assume that approach 3 works because if the original intention of the user was to keep multiple files he would use a timestamp.

@HNOONa-0 HNOONa-0 linked a pull request Dec 16, 2024 that will close this issue
@drigz
Copy link
Member

drigz commented Dec 16, 2024

@HNOONa-0 I only have context on the Bazel integration so maybe you want @sergiud to look at that comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants