-
Notifications
You must be signed in to change notification settings - Fork 28
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
Enable logging to a file #1856
base: master
Are you sure you want to change the base?
Enable logging to a file #1856
Conversation
I should probably mention why I refactored the functions inside runner.rs |
@@ -48,6 +49,7 @@ use crate::{ | |||
}; | |||
|
|||
const LOCK_FILE_NAME: &str = ".lock"; | |||
const LOG_FILE_NAME: &str = "mintlayer.log"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the name should be based on the executable?
/// Log to a file | ||
#[clap(long, action = clap::ArgAction::Set)] | ||
#[arg(hide = true)] | ||
pub log_to_file: Option<bool>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we hide it?
(If not, the description should be more detailed, mentioning that the default value depends on the application and where the logs will be located).
AppendCount::new(2), // total 3 file | ||
ContentLimit::Bytes(100_000_000), // 100MB each |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100 mb seems too much for one file.
IMO we should measure roughly how much logs the node produces in a day and make it the max size. And the number of files can be e.g. 7 (or 10, or 14).
For GUI logging to a file is enabled by default. For other apps it's off with an option to enable it explicitly.