You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/NooBaaNonContainerized/Logging.md
+64-13Lines changed: 64 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -19,10 +19,19 @@ This document provides an overview of the logging capabilities within NooBaa, de
19
19
20
20
## NooBaa Service Logs
21
21
22
-
NooBaa service logs are written directly to stderr and to syslog -
23
-
1. NooBaa writes the logs into stderr and to `/var/log/noobaa.log`.
24
-
2. The `journalctl` service watches stderr and writes it to `journal`.
25
-
3. A `syslog` service, like `rsyslog/syslog_ng` watches `journal` and writes it to `/var/log/messages/`.
22
+
NooBaa service logs are written directly to stderr, syslog, or both.
23
+
1. The `journalctl` service watches stderr and writes into `journal`. That internally updates the `/var/log/messages`.
24
+
2. Noobaa sends logs to a syslog service such as rsyslog or syslog_ng and writes the logs to `/var/log/noobaa.log` if enabled. We can not have more than one service enabled at a time. It might cause some issues.
25
+
26
+
### Set log config
27
+
28
+
Set `LOG_TO_STDERR_ENABLED` property to `true` to send Noobaa logs to stderr. Noobaa logs will be send to syslog when the property `LOG_TO_SYSLOG_ENABLED` set to `true`.
29
+
30
+
Default configurations are:
31
+
```
32
+
LOG_TO_STDERR_ENABLED = true;
33
+
LOG_TO_SYSLOG_ENABLED = false;
34
+
```
26
35
27
36
### Journal logs
28
37
1. NooBaa service logs -
@@ -42,15 +51,15 @@ NooBaa logs are configured using rsyslog and logrotate. NooBaa RPM will configur
42
51
systemctl status rsyslog
43
52
```
44
53
45
-
NooBaa logs are pushed to `var/log/noobaa.log` and the log is rotated and compressed daily.
54
+
NooBaa logs are pushed to `/var/log/noobaa.log` and the log is rotated and compressed daily.
46
55
47
56
The following files contain NooBaa specific configuration for rsyslog and logrotate -
48
57
1.`etc/rsyslog.d/noobaa_syslog.conf`
49
58
2.`etc/logrotate.d/noobaa-logrotate`
50
59
51
60
Verify the rsyslog and logrotate rpm configuration is complete by checking the files above.
Set `NOOBAA_LOG_LEVEL` property in config.json to control the amount of debugging information generated by the application.
80
89
For more info about setting custom properties, see - [Non Containerized Config File Customizations](./ConfigFileCustomizations.md)
81
90
82
-
## NooBaa Logs format
91
+
###NooBaa Logs format
83
92
NooBaa logs are formatted with ANSI color codes. </br>
84
93
Use the `cat <logfile> | less -R` command in order to display the contents of a log file with pagination and the ability to handle ANSI color codes.
85
94
86
-
### Set log config
95
+
## How to configure syslog-ng
96
+
97
+
1. create syslog-ng noobaa specific config file `noobaa-syslog-ng.conf` under `etc/syslog-ng/conf.d/`
98
+
```
99
+
vi etc/syslog-ng/conf.d/noobaa-syslog-ng.conf
100
+
```
101
+
2. update the file with bellow configuration
87
102
88
-
Set `LOG_TO_STDERR_ENABLED` property to `true` to send Noobaa logs to stderr. Noobaa logs will be send to syslog when the property `LOG_TO_SYSLOG_ENABLED` set to `true`.
We are creating two new destination one is `d_noobaa_msg`, point to log file `/var/log/noobaa.log` and another one is `d_noobaa_event` , point to log file `/var/log/noobaa_events.log`
114
+
Filter `f_noobaa_msg` and `f_noobaa_event` will filter out only noobaa logs and events log. Last created two source that will filter and log only noobaa normal logs and events to previously added destinations.
115
+
116
+
3. Update existing filter `f_default` in default syslog-ng `etc/syslog-ng/syslog-ng.conf` to make sure noobaa logs and event are not send to `/var/log/message` log file.
117
+
```
118
+
vi etc/syslog-ng/syslog-ng.conf
119
+
// update file for filter f_default
120
+
filter f_default { level(info..emerg) and
121
+
not (facility(mail)
122
+
or facility(local0)
123
+
or facility(local2)
124
+
or facility(authpriv)
125
+
or facility(cron)); };
126
+
```
127
+
Noobaa logs with facility local0 and local2 are excluded from message logs
128
+
4. restart syslog-ng
129
+
```
130
+
systemctl restart syslog-ng
131
+
```
132
+
133
+
### Known issues
134
+
135
+
1. missing logs due to systemd-journald log suppression
136
+
`Suppressed 6284127 messages from noobaa.service`
137
+
138
+
solution :
139
+
* Edit /etc/systemd/journald.conf
140
+
* add below configuration
141
+
```
142
+
RateLimitInterval=0
143
+
RateLimitBurst=0
144
+
```
145
+
link : https://my.f5.com/manage/s/article/K70501143
0 commit comments