Basic troubleshooting by using log files

Investigate system problems by examining journal entries and traditional log files. Filtering logs by time, service, and priority helps you quickly narrow down the root cause.

Before you begin

  • You are logged in to the system.

Procedure

  1. View log messages from the current boot:
    $ journalctl -b
  2. Filter log messages by a specific time range:
    $ journalctl --since "2025-07-01 08:00:00" --until "2025-07-01 12:00:00"
  3. Display only error and higher-priority messages:
    $ journalctl -p err -b
  4. Filter messages by a specific service:
    $ journalctl -u <service_name>.service -b
  5. Examine traditional log files for services that do not log through the journal:
    # cat /var/log/messages

    Some services store logs in subdirectories under /var/log/. For example, the httpd service uses /var/log/httpd/.

  6. Follow new log entries in real time to observe ongoing issues:
    $ journalctl -f

Results

  • Verify that the log output contains entries relevant to the issue you are investigating, such as error messages, failed service starts, or unexpected reboots.