Checking the Logs for Starting, Restarting, and Stopping Apache - CentOS 7

To check the logs of starting, restarting and stopping Apache, narrow down the logs displayed by the journalctl command to only Apache logs by using "-u httpd".

journalctl -u httpd

Here is a sample of the output

journalctl -u httpd
eb 03 14:54:56 vs01 systemd[1]: Reloaded The Apache HTTP Server.
Feb 03 14:56:44 vs01 systemd[1]: Stopping The Apache HTTP Server...
Feb 03 14:57:02 vs01 systemd[1]: Starting The Apache HTTP Server...
Feb 03 14:57:03 vs01 systemd[1]: Started The Apache HTTP Server...
Feb 03 15:00:03 vs01 systemd[1]: Reloaded The Apache HTTP Server.

View from the end

Use the "-r" option to display the logs of starting, restarting and stopping Apache in reverse order, starting from the end.

journalctl -r -u httpd

Automatically retrieve the tail

Use the "-f" option to automatically retrieve the end of the log and make it behave like the "-f" option of the tail command.

journalctl -f -u httpd

Associated Information