Ubuntu - SystemD - Logs - Show logs of a unit

For instance, the ssh service unit.

sudo journalctl -u ssh

To view Postfix logs, run

sudo journalctl -u postfix

NOTE: Some packages may still be configured to save logs to plain files such as the Postfix log files on Ubuntu (/var/log/mail.log).

  • Use a command-line text editor to peruse the logs.