diff options
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/README.md | 2 | ||||
-rw-r--r-- | daemon/config/README.md | 1 | ||||
-rw-r--r-- | daemon/main.c | 4 |
3 files changed, 7 insertions, 0 deletions
diff --git a/daemon/README.md b/daemon/README.md index e37c17cf65..0707a406c1 100644 --- a/daemon/README.md +++ b/daemon/README.md @@ -143,6 +143,8 @@ For most Netdata programs (including standard external plugins shipped by netdat | `ERROR` | Something that might disable a part of netdata.<br/>The log line includes `errno` (if it is not zero). | | `FATAL` | Something prevented a program from running.<br/>The log line includes `errno` (if it is not zero) and the program exited. | +The `FATAL` and `ERROR` messages will always appear in the logs, and `INFO`can be filtered using [severity level](https://github.com/netdata/netdata/tree/master/daemon/config#logs-section-options) option. + So, when auto-detection of data collection fail, `ERROR` lines are logged and the relevant modules are disabled, but the program continues to run. diff --git a/daemon/config/README.md b/daemon/config/README.md index 53ba42f5bd..11ba2a1bc7 100644 --- a/daemon/config/README.md +++ b/daemon/config/README.md @@ -139,6 +139,7 @@ Please note that your data history will be lost if you have modified `history` p | facility | `daemon` | A facility keyword is used to specify the type of system that is logging the message. | | errors flood protection period | `1200` | Length of period (in sec) during which the number of errors should not exceed the `errors to trigger flood protection`. | | errors to trigger flood protection | `200` | Number of errors written to the log in `errors flood protection period` sec before flood protection is activated. | +| severity level | `info` | Controls which log messages are logged, with error being the most important. Supported values: `info` and `error`. | ### [environment variables] section options diff --git a/daemon/main.c b/daemon/main.c index 9460223a4c..59c02bb498 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -874,6 +874,10 @@ static void log_init(void) { setenv("NETDATA_ERRORS_THROTTLE_PERIOD", config_get(CONFIG_SECTION_LOGS, "errors flood protection period" , ""), 1); setenv("NETDATA_ERRORS_PER_PERIOD", config_get(CONFIG_SECTION_LOGS, "errors to trigger flood protection", ""), 1); + + char *selected_level = config_get(CONFIG_SECTION_LOGS, "severity level", NETDATA_LOG_LEVEL_INFO_STR); + global_log_severity_level = log_severity_string_to_severity_level(selected_level); + setenv("NETDATA_LOG_SEVERITY_LEVEL", selected_level , 1); } char *initialize_lock_directory_path(char *prefix) |