log flood protection to 1000 log lines / 1 minute (#16450)
Ilya Mashchenko committed
Nov 22, 2023 at 22:12 UTC
2a58bd96ff03e6e1a8975db919e3de5b3b2b2e5e
2 files changed
+19
-17
libnetdata/log/README.md
+17
-15
@@ -45,24 +45,26 @@ All other sources default to a file.
45
46
## Log formats
47
48
-Netdata supports the follow formats for its logs:
49
-
50
-- **journal**, this is automatically selected when logging to systemd-journal.
51
-- **logfmt**, this is the default when logging to any output other than `journal`. In this format, Netdata annotates the fields to make them human readable.
52
-- **json**, to write logs lines in json format. The output is machine readable, similar to `journal`.
48
+| Format | Description |
49
+|---------|--------------------------------------------------------------------------------------------------------|
50
+| journal | journald-specific log format. Automatically selected when logging to systemd-journal. |
51
+| logfmt | logs data as a series of key/value pairs. The default when logging to any output other than `journal`. |
52
+| json | logs data in JSON format. |
53
54
## Log levels
55
56
Each time Netdata logs, it assigns a priority to the log. It can be one of this (in order of importance):
57
58
-- **emergency**, a fatal condition; most likely Netdata will exit immediately after,
59
-- **alert**, a very important issue that may affect how Netdata operates,
60
-- **critical**, a very important issue the user should know which, Netdata thinks it can survive,
61
-- **error**, an error condition indicating that Netdata is trying to do something but it fails,
62
-- **warning**, something that may or may not affect the operation of Netdata, but the outcome cannot be determined at the time Netdata logs,
63
-- **notice**, something that does not affect the operation of Netdata, but the user should notice,
64
-- **info**, the default log level about information the user should know,
65
-- **debug**, these are more verbose logs that can be ignored,
58
+| Level | Description |
59
+|-----------|----------------------------------------------------------------------------------------|
60
+| emergency | a fatal condition, Netdata will most likely exit immediately after. |
61
+| alert | a very important issue that may affect how Netdata operates. |
62
+| critical | a very important issue the user should know which, Netdata thinks it can survive. |
63
+| error | an error condition indicating that Netdata is trying to do something, but it fails. |
64
+| warning | something unexpected has happened that may or may not affect the operation of Netdata. |
65
+| notice | something that does not affect the operation of Netdata, but the user should notice. |
66
+| info | the default log level about information the user should know. |
67
+| debug | these are more verbose logs that can be ignored. |
68
69
## Logs Configuration
70
@@ -70,8 +72,8 @@ In `netdata.conf`, there are the following settings:
72
73
```
74
[logs]
73
- # logs to trigger flood protection = 600
74
- # logs flood protection period = 3600
75
+ # logs to trigger flood protection = 1000
76
+ # logs flood protection period = 60
77
# facility = daemon
78
# level = info
79
# daemon = journal
libnetdata/log/log.h
+2
-2
@@ -9,8 +9,8 @@ extern "C" {
9
10
#include "../libnetdata.h"
11
12
-#define ND_LOG_DEFAULT_THROTTLE_LOGS 1200
13
-#define ND_LOG_DEFAULT_THROTTLE_PERIOD 3600
12
+#define ND_LOG_DEFAULT_THROTTLE_LOGS 1000
13
+#define ND_LOG_DEFAULT_THROTTLE_PERIOD 60
14
15
typedef enum __attribute__((__packed__)) {
16
NDLS_UNSET = 0, // internal use only