mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
config file improvements (#241)
* remove log_to_file param * change the place of workers
This commit is contained in:
@@ -155,11 +155,9 @@ Clio provides several logging options, all are configurable via the config file
|
||||
`log_level`: The minimum level of severity at which the log message will be outputted.
|
||||
Severity options are `trace`, `debug`, `info`, `warning`, `error`, `fatal`.
|
||||
|
||||
`log_to_console`: Enable/disable log output to console. Options are `true`/`false`.
|
||||
`log_to_console`: Enable/disable log output to console. Options are `true`/`false`. Defaults to true.
|
||||
|
||||
`log_to_file`: Enable/disable log saving to files in persistent local storage. Options are `true`/`false`.
|
||||
|
||||
`log_directory`: Path to the directory where log files are stored. If such directory doesn't exist, Clio will create it.
|
||||
`log_directory`: Path to the directory where log files are stored. If such directory doesn't exist, Clio will create it. If not specified, logs are not written to a file.
|
||||
|
||||
`log_rotation_size`: The max size of the log file in **megabytes** before it will rotate into a smaller file.
|
||||
|
||||
|
||||
@@ -115,8 +115,7 @@ initLogging(boost::json::object const& config)
|
||||
{
|
||||
boost::log::add_console_log(std::cout, keywords::format = format);
|
||||
}
|
||||
if (config.contains("log_to_file") && config.at("log_to_file").as_bool() &&
|
||||
config.contains("log_directory"))
|
||||
if (config.contains("log_directory"))
|
||||
{
|
||||
if (!config.at("log_directory").is_string())
|
||||
throw std::runtime_error("log directory must be a string");
|
||||
|
||||
@@ -321,8 +321,8 @@ make_HttpServer(
|
||||
static_cast<unsigned short>(serverConfig.at("port").as_int64());
|
||||
|
||||
uint32_t numThreads = std::thread::hardware_concurrency();
|
||||
if (serverConfig.contains("workers"))
|
||||
numThreads = serverConfig.at("workers").as_int64();
|
||||
if (config.contains("workers"))
|
||||
numThreads = config.at("workers").as_int64();
|
||||
uint32_t maxQueueSize = 0; // no max
|
||||
if (serverConfig.contains("max_queue_size"))
|
||||
maxQueueSize = serverConfig.at("max_queue_size").as_int64();
|
||||
|
||||
Reference in New Issue
Block a user