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

feat: rotating logs #14008

Merged
merged 8 commits into from
Dec 14, 2023
Merged

feat: rotating logs #14008

merged 8 commits into from
Dec 14, 2023

Conversation

yufan022
Copy link
Contributor

@yufan022 yufan022 commented Dec 13, 2023

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Scroll to clean up the historical logs, 48 hours by default.

Here are the cleaning rules:
https://github.com/tokio-rs/tracing/blob/bac25085fcea68ca30b8e19b8981fbd689f53735/tracing-appender/src/rolling/builder.rs#L199-L206

databend-query-test_cluster.2023-12-13-16-53
The prefix of log name must be the same, so I removed node_id and distinguished trace_name from log_name

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Dec 13, 2023
@BohuTANG
Copy link
Member

error[E0061]: this function takes 3 arguments but 2 arguments were supplied
   --> src/common/tracing/src/init.rs:222:51
    |
222 |             let (profile_log_file, flush_guard) = new_file_log_writer(&cfg.profile.dir, name);
    |                                                   ^^^^^^^^^^^^^^^^^^^------------------------ an argument of type `usize` is missing
    |
note: function defined here
   --> src/common/tracing/src/loggers.rs:40:15
    |
40  | pub(crate) fn new_file_log_writer(
    |               ^^^^^^^^^^^^^^^^^^^
41  |     dir: &str,
    |     ---------
42  |     name: impl ToString,
    |     -------------------
43  |     max_files: usize,
    |     ----------------
help: provide the argument
    |
222 |             let (profile_log_file, flush_guard) = new_file_log_writer(&cfg.profile.dir, name, /* usize */);
    |                                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For more information about this error, try `rustc --explain E0061`.
error: could not compile `common-tracing` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.

https://github.com/datafuselabs/databend/actions/runs/7198497812/job/19608101904?pr=14008#step:4:7260

@BohuTANG BohuTANG requested a review from everpcpc December 13, 2023 23:52
@BohuTANG
Copy link
Member

@yufan022
Thanks for you contribution!

@BohuTANG BohuTANG merged commit 9fd1304 into databendlabs:main Dec 14, 2023
72 checks passed
@yufan022 yufan022 deleted the rotating_log branch December 14, 2023 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants