From ade64b0ce84508f5c8f2852576737106abf35276 Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Tue, 19 May 2020 08:43:06 +0000 Subject: [PATCH] update(userspace/falco): make log level a configuration member Signed-off-by: Leonardo Di Donato --- cmake/modules/sysdig.cmake | 2 +- userspace/falco/configuration.cpp | 6 +++--- userspace/falco/configuration.h | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/modules/sysdig.cmake b/cmake/modules/sysdig.cmake index 576a26d9..28b49bf6 100644 --- a/cmake/modules/sysdig.cmake +++ b/cmake/modules/sysdig.cmake @@ -16,7 +16,7 @@ set(SYSDIG_CMAKE_WORKING_DIR "${CMAKE_BINARY_DIR}/sysdig-repo") # this needs to be here at the top if(USE_BUNDLED_DEPS) - # explicitly force this dependency to use the system OpenSSL + # explicitly force this dependency to use the bundled OpenSSL set(USE_BUNDLED_OPENSSL ON) endif() diff --git a/userspace/falco/configuration.cpp b/userspace/falco/configuration.cpp index f1cd09e0..0b1bb940 100644 --- a/userspace/falco/configuration.cpp +++ b/userspace/falco/configuration.cpp @@ -151,7 +151,7 @@ void falco_configuration::init(string conf_filename, list &cmdline_optio m_grpc_threadiness = m_config->get_scalar("grpc", "threadiness", 8); // todo > limit it to avoid overshubscription? std::thread::hardware_concurrency() if(m_grpc_threadiness == 0) { - throw logic_error("error reading config file (" + m_config_file +"): gRPC threadiness must be greater than 0"); + throw logic_error("error reading config file (" + m_config_file + "): gRPC threadiness must be greater than 0"); } m_grpc_private_key = m_config->get_scalar("grpc", "private_key", "/etc/falco/certs/server.key"); m_grpc_cert_chain = m_config->get_scalar("grpc", "cert_chain", "/etc/falco/certs/server.crt"); @@ -170,9 +170,9 @@ void falco_configuration::init(string conf_filename, list &cmdline_optio throw logic_error("Error reading config file (" + m_config_file + "): No outputs configured. Please configure at least one output file output enabled but no filename in configuration block"); } - string log_level = m_config->get_scalar("log_level", "info"); + m_log_level = m_config->get_scalar("log_level", "info"); - falco_logger::set_level(log_level); + falco_logger::set_level(m_log_level); m_notifications_rate = m_config->get_scalar("outputs", "rate", 1); m_notifications_max_burst = m_config->get_scalar("outputs", "max_burst", 1000); diff --git a/userspace/falco/configuration.h b/userspace/falco/configuration.h index ee39ee54..28cf06af 100644 --- a/userspace/falco/configuration.h +++ b/userspace/falco/configuration.h @@ -195,6 +195,7 @@ public: std::list m_rules_filenames; bool m_json_output; bool m_json_include_output_property; + std::string m_log_level; std::vector m_outputs; uint32_t m_notifications_rate; uint32_t m_notifications_max_burst;