diff --git a/README.md b/README.md index def0a42a..a4436407 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/src/main/main.cpp b/src/main/main.cpp index 540c9ac0..fb7c9d3a 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -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"); diff --git a/src/webserver/Listener.h b/src/webserver/Listener.h index 2f7a2c3f..79dd22d8 100644 --- a/src/webserver/Listener.h +++ b/src/webserver/Listener.h @@ -321,8 +321,8 @@ make_HttpServer( static_cast(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();