Skip to content

Commit 0d142f9

Browse files
authored
Merge pull request #1727 from agrare/add_docs_collect_logs_utilities
Add documentation on the usage of the collect_logs utilities
2 parents 0c456fd + 54c5215 commit 0d142f9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

troubleshooting/_topics/appliance_logging.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
### Appliance Logging
22

3+
#### Viewing Logs
4+
35
On appliances logging is managed using the built-in systemd-journal system. Journald uses database-like binary files to store log lines along with extensive metadata.
46

57
There is a `journalctl` command-line utility which can be used to query the journal. Documentation for journalctl can be found at https://man7.org/linux/man-pages/man1/journalctl.1.html
@@ -35,3 +37,15 @@ Other:
3537
- Clear out journal archives over a day old: `journalctl --vacuum-time=1d`
3638

3739
Almost all of these can be combined together where they don't conflict (e.g. `-f` can't be used with `-r`)
40+
41+
#### Collecting Logs
42+
43+
If you have to collect logs from appliances for diagnostic purposes there are a couple utilities that are provided for this purpose.
44+
45+
To collect logs from only a single appliance you can use `collect_current_logs.sh` or `collect_archive_logs.sh`. To use these utilities you should ssh to the appliance and `cd /var/www/miq/vmdb/tools/collect_logs` directory.
46+
47+
Now run `./collect_current_logs.sh` or `./collect_archive_logs.sh` depending on if you want the latest or all logs.
48+
49+
The output will be in `/var/www/miq/vmdb/log/evm_current_HOSTNAME_TIMESTAMP.tar.xz` or `/var/www/miq/vmdb/log/evm_archive_HOSTNAME_TIMESTAMP.tar.xz`
50+
51+
To collect logs from all appliances in the region over ssh we provide a `collect_all_logs` utility. This iterates over all `MiqServer` records in the region and collects the output of `collect_current_logs.sh` rolled up into a single `.tar.xz` file.

0 commit comments

Comments
 (0)