config file improvements (#241)

* remove log_to_file param
* change the place of workers
This commit is contained in:
CJ Cobb
2022-08-10 11:05:54 -04:00
committed by CJ Cobb
parent d50f229631
commit 84d31986d1
3 changed files with 5 additions and 8 deletions

View File

@@ -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.

View 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");

View File

@@ -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();