Troubleshooting: Logs


Actively follow the logs as they are being written

journalctl -f

Send command to background while logging

# Start a program as a background job with an "&" on the command line.
myprogram &
# In the above example, # note that output (both stdout and stderr) will still go to the current tty,
# it's generally a good idea to redirect to /dev/null or to a log file, like so:
myprogram > ~/program.log 2>&1 &


List systemd

systemctl list-unit-files --type=service

Service status

systemctl status service-name

Service status with more lines

systemctl status service-name -n50

Full log for service

journalctl -u service-name.service

Full log for service for current boot

journalctl -u service-name.service -b

List services in failed state

systemctl list-units --state=failed