List units and see log of units.
When you have some trouble in http, you want to see httpd log. Then, you can see httpd log by journalctl -u httpd
. You can check which service is running by systemctl list-units
.
systemctl list-units # you can see list of running services.
journalctl -u httpd
journalctl -u mysqld
# ...etc
Make log persistent
When you want to keep log after server shutdown, you should edit /etc/systemd/journald.conf
and add line Storage=persistent
.
/etc/systemd/journald.conf
[Journal]
#Storage=auto
Storage=persistent
#Compress=yes