Skip to content

Commit

Permalink
refactor(userspace/falco): make sinsp logging part of the configurati…
Browse files Browse the repository at this point in the history
…on (default to false)

Signed-off-by: Jason Dellaluce <[email protected]>
  • Loading branch information
jasondellaluce authored and poiana committed Jul 7, 2022
1 parent bae68b3 commit 7dade32
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions falco.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ log_syslog: true
# "alert", "critical", "error", "warning", "notice", "info", "debug".
log_level: info

# Falco is capable of managing the logs coming from libs. If enabled,
# the libs logger send its log records the same outputs supported by
# Falco (stderr and syslog). Disabled by default.
libs_logger:
enabled: false
# Minimum log severity to include in the libs logs. Note: this value is
# separate from the log level of the Falco logger and does not affect it.
# Can be one of "fatal", "critical", "error", "warning", "notice",
# "info", "debug", "trace".
severity: debug

# Minimum rule priority level to load and run. All rules having a
# priority more severe than this level will be loaded/run. Can be one
# of "emergency", "alert", "critical", "error", "warning", "notice",
Expand Down
6 changes: 6 additions & 0 deletions userspace/falco/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ void falco_configuration::init(string conf_filename, const vector<string> &cmdli

falco_logger::set_level(m_log_level);


falco_logger::set_sinsp_logging(
m_config->get_scalar<bool>("libs_logger.enabled", false),
m_config->get_scalar<std::string>("libs_logger.severity", "debug"),
"[libs]: ");

m_output_timeout = m_config->get_scalar<uint32_t>("output_timeout", 2000);

m_notifications_rate = m_config->get_scalar<uint32_t>("outputs.rate", 1);
Expand Down

0 comments on commit 7dade32

Please sign in to comment.