Payments are experiencing issues due to temporary restrictions in Russia. If your payment does not go through, please submit a support request.Our support team is available 24/7 — we are always here to help with hosting and server issues.We are now accepting requests for dedicated server rental and colocation services in our data center.Reminder: we recommend enabling backups for additional data protection.A new VPS/VDS lineup with NVMe storage and improved performance is now available.Maintenance work on some servers has been completed. All services are operating normally.
Article3 min readViews0

How to Find the Right Error in the systemd Journal Using journalctl

Filter messages by service, boot, and time to analyze a specific failure without dumping the entire journal and losing critical lines.

Specialist reviewing diagnostic data on a laptop
In this article

The message "service crashed again" is hard to act on without time and context. The systemd journal helps reconstruct the sequence: what happened before the failure, which operation ended in error, and whether a subsequent successful start occurred. Start with a narrow window that actually relates to the incident.

Select the service and time range

This guide applies to Linux with systemd and access to the log. The example uses nginx.service. Replace this name with the actual installed unit. Viewing other users' system logs may require administrator permissions; the absence of visible entries for a regular user does not mean events are missing.

journalctl -u nginx.service --since '-30 min' --no-pager -o short-iso

The command outputs messages from the selected service for the last thirty minutes. The time format is convenient for correlating with monitoring. Check the time zone: the timestamp in the browser panel and the server's local time may differ.

Refine the server boot

If the incident involved a reboot, distinguish the current journal from the previous one. View available boots:

journalctl --list-boots --no-pager

Then, for the relevant case, you can select a previous boot:

journalctl -b -1 -u nginx.service --no-pager -o short-iso

This selection works only if saved records exist. If the journal is stored only in memory, data prior to the boot might not have been saved. Do not treat the absence of a previous boot as proof that the service was error-free at that time.

Do not limit yourself to high-priority lines

Filtering only for errors is convenient, but it can obscure the root cause. Before a failure, there may have been routine messages about configuration changes, dependency stops, or signal reception. First, read a small complete interval, then narrow the selection.

For example, an application reports an inability to open a socket. Previous lines may show which path it used and why it switched to this configuration option. A single last line without context leaves several equally plausible hypotheses.

What to do with the found record

Correlate the event with a specific action: an update, import, configuration change, or load increase. A time match is useful, but alone it does not prove causality. Check whether the same failure repeats under the same scenario and whether a record of successful recovery appeared afterward.

Do not clear or truncate the log during the initial review. Clearing does not fix the root cause and may destroy data needed for comparison. If disk space is low, rotation should be handled separately, taking storage requirements into account.

Result Transfer

To support the investigation, prepare the service name, time range, time zone, and several related messages before and after the error. Remove tokens, personal data, and request content from the text if they appear in the log. After the fix, repeat the same scenario and verify that the error does not reappear. A useful summary is a sequence of events and a testable hypothesis, not an archive of all server logs.

Discussion 0

Share your experience and ask questions. Comments without links appear after editorial review.

No comments yet. Start the discussion.