Debian /ubuntu based distros
sudo inxi -U ; ( date & inxi -c0 -Fzxxtcm5 & grep -B1 -A1 -Ei 'warn|fail|error|critical' /var/log/syslog & date ) > ~/trouble-shoot-history.txt
RPMe Based distros
sudo inxi -U ; ( date & inxi -c0 -Fzxxtcm5 & grep -B1 -A1 -Ei 'warn|fail|error|critical' /var/log/messages & date ) > ~/trouble-shoot-history.txt
systemd based distros, change the 'priority' value to suit your needs
sudo journalctl -b --merge --priority=3 > ~/trouble-shoot-history.txt