LoginSignup
0
0

More than 3 years have passed since last update.

How to check log of specific service in Linux

Last updated at Posted at 2021-01-23

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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0