diff options
author | stoffu <stoffu@protonmail.ch> | 2018-06-01 12:29:26 +0900 |
---|---|---|
committer | stoffu <stoffu@protonmail.ch> | 2018-06-13 12:44:27 +0900 |
commit | 63d0ab09b5445ce5d1dfa84d6600e61deef70601 (patch) | |
tree | e3a868d7d1633d825d5a30634f59ac677058d034 /src/daemon | |
parent | Merge pull request #3866 (diff) | |
download | monero-63d0ab09b5445ce5d1dfa84d6600e61deef70601.tar.xz |
mlog: --max-log-files to set the max number of rotated log files
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/command_line_args.h | 5 | ||||
-rw-r--r-- | src/daemon/main.cpp | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/daemon/command_line_args.h b/src/daemon/command_line_args.h index 4673590aa..cba71bf3b 100644 --- a/src/daemon/command_line_args.h +++ b/src/daemon/command_line_args.h @@ -72,6 +72,11 @@ namespace daemon_args , "Specify maximum log file size [B]" , MAX_LOG_FILE_SIZE }; + const command_line::arg_descriptor<std::size_t> arg_max_log_files = { + "max-log-files" + , "Specify maximum number of rotated log files to be saved (no limit by setting to 0)" + , MAX_LOG_FILES + }; const command_line::arg_descriptor<std::string> arg_log_level = { "log-level" , "" diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index 49494e889..822be0d70 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -84,6 +84,7 @@ int main(int argc, char const * argv[]) command_line::add_arg(core_settings, daemon_args::arg_log_file); command_line::add_arg(core_settings, daemon_args::arg_log_level); command_line::add_arg(core_settings, daemon_args::arg_max_log_file_size); + command_line::add_arg(core_settings, daemon_args::arg_max_log_files); command_line::add_arg(core_settings, daemon_args::arg_max_concurrency); command_line::add_arg(core_settings, daemon_args::arg_zmq_rpc_bind_ip); command_line::add_arg(core_settings, daemon_args::arg_zmq_rpc_bind_port); @@ -203,7 +204,7 @@ int main(int argc, char const * argv[]) if (!command_line::is_arg_defaulted(vm, daemon_args::arg_log_file)) log_file_path = command_line::get_arg(vm, daemon_args::arg_log_file); log_file_path = bf::absolute(log_file_path, relative_path_base); - mlog_configure(log_file_path.string(), true, command_line::get_arg(vm, daemon_args::arg_max_log_file_size)); + mlog_configure(log_file_path.string(), true, command_line::get_arg(vm, daemon_args::arg_max_log_file_size), command_line::get_arg(vm, daemon_args::arg_max_log_files)); // Set log level if (!command_line::is_arg_defaulted(vm, daemon_args::arg_log_level)) |