Skip to content
Commit 41167a2a authored by Jian Zhang's avatar Jian Zhang Committed by Jayanth Othayoth
Browse files

dreport: collecting all namespace journal logs

For BMCs that support multiple namespaces to manage logs, add the
--namespace=* option to the journalctl command to collect all logs.

refer to systemd-journald.service.html[0].

Tested:
1. Prepare a namespace configuration, to isolate logs (in general for
   the third-party code, like silicon vendor, etc), avoid too many
   unexpected to noise the system.
```
~# cp /etc/systemd/journald.conf /etc/systemd/journald@intel.conf
~# mkdir -p /etc/systemd/system/com.intel.crashdump.service.d
~# echo "[Service]" > /etc/systemd/system/com.intel.crashdump.service.d/override.conf
~# echo "LogNamespace=intel" >> /etc/systemd/system/com.intel.crashdump.service.d/override.conf
~# reboot # or restart systemd-journald, and daemon-reload
````

2. using journalctl vs journalctl --namespace=*
```
~# journalctl -u com.intel.crashdump.service
Dec 10 16:56:49 xxx systemd[1]: Starting Intel BMC CPU Crashdump...
Dec 10 16:56:55 xxx systemd[1]: Started Intel BMC CPU Crashdump.
```

```
~# journalctl --namespace=*
Dec 10 16:56:49 xxx systemd[1]: Starting Intel BMC CPU Crashdump...
Dec 10 16:56:55 xxx systemd[1]: Started Intel BMC CPU Crashdump.
Dec 10 16:56:57 xxx crashdump[258]: Crashdump version: ....
Dec 10 16:56:57 xxx crashdump[258]: Initializing crashdump...
....
```

3. After this change, check the journal logs, and the journal logs
   should be collect the logs from all namespaces.
```
cat journal-pretty.log| ag "Initializing crashdump"
	"MESSAGE" : "Initializing crashdump...",
```

[0]: https://www.freedesktop.org/software/systemd/man/latest/systemd-journald.service.html#Journal%20Namespaces



Change-Id: I70f33eb6119cbe041bb0dc2aac527e02d8f5e757
Signed-off-by: default avatarJian Zhang <zhangjian.3032@bytedance.com>
parent d56bab55
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment