mirror of
https://github.com/monero-project/monero.git
synced 2025-08-06 07:04:20 -04:00
daemon, wallet: add --max-log-file-size option
This commit is contained in:
parent
13a263894a
commit
91def9a59b
5 changed files with 14 additions and 5 deletions
|
@ -111,7 +111,7 @@ static const char *get_default_categories(int level)
|
|||
return categories;
|
||||
}
|
||||
|
||||
void mlog_configure(const std::string &filename_base, bool console)
|
||||
void mlog_configure(const std::string &filename_base, bool console, const std::size_t max_log_file_size)
|
||||
{
|
||||
el::Configurations c;
|
||||
c.setGlobally(el::ConfigurationType::Filename, filename_base);
|
||||
|
@ -121,7 +121,7 @@ void mlog_configure(const std::string &filename_base, bool console)
|
|||
log_format = MLOG_BASE_FORMAT;
|
||||
c.setGlobally(el::ConfigurationType::Format, log_format);
|
||||
c.setGlobally(el::ConfigurationType::ToStandardOutput, console ? "true" : "false");
|
||||
c.setGlobally(el::ConfigurationType::MaxLogFileSize, "104850000"); // 100 MB - 7600 bytes
|
||||
c.setGlobally(el::ConfigurationType::MaxLogFileSize, std::to_string(max_log_file_size));
|
||||
el::Loggers::setDefaultConfigurations(c, true);
|
||||
|
||||
el::Loggers::addFlag(el::LoggingFlag::HierarchicalLogging);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue