Ubuntu Logs: Troubleshooting with journalctl and dmesg

Illustrated infographic summarizing: Ubuntu Logs Journalctl and Dmesg

By Greg Nowak. Updated 16 November 2026.

When checkout stops working or a scheduled import fails, a server log becomes useful when it helps explain the interruption. The practical questions are: what failed first, what changed, and what needs to happen next?

On Ubuntu, journalctl and dmesg are good starting points. For business owners and operations leads, the workflow below helps you ask better questions of your technical team. For developers and agencies, it provides a repeatable way to investigate and hand over evidence.

Choose the log that matches the symptom

journalctl reads the systemd journal. The journal collects several kinds of messages, including kernel events and service output. dmesg reads the kernel ring buffer. The systemd journal service documentation describes those inputs; application logs written separately still need checking.

Symptom Start here Question to answer
A service will not start or keeps stopping Service journal What happened immediately before the failure?
Storage errors, device resets, or suspected memory exhaustion Kernel messages Did a system resource problem affect the application?
An interruption before a reboot Journal from the previous boot What evidence survived the restart?
A failed request, checkout, or background job Application logs alongside the service journal Can the failure be matched to a request or job identifier?
Start with the affected function, then narrow the investigation by time and service.

Pin down the incident window

Record the affected site or server, the visible symptom, the approximate time, and any recent deployment or configuration change. Include the timezone. “The import failed at 09:15 UTC” gives the team something specific to investigate.

For an initial look, use an authorised administrator account:

sudo journalctl --since "1 day ago"
sudo journalctl --since "10 hours ago"

Under systemd’s time syntax, “1 day ago” means a rolling 24 hours; “yesterday” means midnight at the start of yesterday. Explicit boundaries make a shared investigation reproducible:

sudo journalctl --since "2026-11-16 09:00:00 UTC" --until "2026-11-16 09:30:00 UTC" --utc --no-pager

Replace these example times with your incident window. Start a few minutes before the first reported failure: a customer may notice the problem after it began.

Find an error, then read what came before it

sudo journalctl --since "12 hours ago" -p 3 -x --utc --no-pager

-p 3 selects errors and more severe messages; -x adds explanations where available. --utc displays UTC timestamps, and --no-pager prints without an interactive pager. The journalctl manual advises leaving out -x when attaching output to bug reports.

Once you find a plausible error, inspect a smaller time window without the priority filter. Ordinary messages may show a deployment, shutdown, or retry that explains the sequence. An error on the same server is a lead to check; its severity alone does not connect it to the customer’s problem.

Follow the affected service

Replace nginx.service with the actual systemd unit name:

sudo journalctl -u nginx.service --since "1 hour ago"
sudo journalctl -u nginx.service -n 50 -f

The second command shows the latest 50 entries and follows new messages. Press Ctrl+C to stop.

Use it alongside a safe test of the affected function. Record the test time and any request identifier. If the service journal shows nothing useful, check where the application writes its own logs, including any container logging system.

After an agreed fix, repeat the business task that failed. A running web server does not establish that checkout, email delivery, or a scheduled import works again. Keep one person responsible for confirming recovery so that developers, the agency, and the hosting provider share the same definition of success.

Use dmesg for kernel clues

sudo dmesg | less
sudo dmesg -H --time-format iso

Either command lets you browse kernel messages. -H enables a pager, so the second command needs no extra pipe. Press q to exit.

Look for storage I/O errors, device resets, network interface changes, or a process killed during memory exhaustion. Match the timing and affected component before deciding on a fix. A killed process, for example, needs investigation into memory demand and limits before simply increasing server capacity.

The Ubuntu dmesg manual warns that ISO timestamps can be inaccurate after suspend and resume. Access can also be restricted: “permission denied” does not mean there are no messages.

Check what survived a reboot

sudo journalctl --list-boots
sudo journalctl -b -1
sudo journalctl -k -b -1

These list retained boots, show the previous boot, and restrict that boot to kernel messages. They work only while the relevant journal data remains available.

If evidence is missing, review storage and retention before the next incident. In journald’s configuration, Storage=volatile uses memory, while Storage=persistent prefers disk. With Storage=auto, the presence of /var/log/journal determines the behaviour. Check local configuration and drop-ins rather than assuming an Ubuntu-wide default.

Persistent storage still has limits. Agree how much history the team needs, account for available disk space, and recognise that changing retention cannot recover logs already lost.

Hand over evidence and a clear next step

Share the affected function, server and service names, incident window with timezone, relevant excerpts, recent changes, and tests performed. Keep surrounding messages that explain the sequence. Remove credentials and customer information before sharing.

Separate what the logs establish from what remains a hypothesis. Assign the next investigation or fix to a named owner, and record how recovery will be checked.

If recurring Ubuntu problems are disrupting delivery, I can help coordinate the investigation with your developers or hosting provider and turn the findings into practical next steps. Contact Greg with the symptoms, your setup, and where the team is getting stuck.

Related on GrN.dk

Need help with this kind of work?

Discuss your Ubuntu server issue with Greg Get in touch with Greg.

Sources

Latest articles

Find subscriptions and insurance expenses in e-conomic that should be spread over several months. See how AI reads the supporting documents and how your finance lead approves the proposed allocations.

Before relying on an AI project briefing, check which files it covered. A practical workflow for tracking documents, recording gaps and verifying key claims.

Check whether your contact form rejects missing or invalid Turnstile tokens, handles failed checks for genuine users and delivers accepted enquiries to your team.

Compare Bing citations, identifiable AI visits and verified enquiries to see which pages deserve attention before you increase your AI search marketing budget.

Teamtailor is phasing out Riminder on 21 November 2026. Check your parser settings, contact fields and integrations, and make sure you have a process for deleting applicant data.

WordPress jobs running late? Learn how to separate scheduling problems, task errors and a growing backlog, then choose the right scheduler or runner.

Before changing an AI workflow, check that it still does the job. Use realistic examples, clear release criteria and a comparison with the version running today.

Sending an invoice does not mean it has arrived. Understand delivery statuses, the system requirements coming in 2027, and how focused AI support can help finance teams handle errors and follow-up.

Before scaling AI content, check the pages you already have. Verify claims, resolve overlapping coverage, and give WordPress reviewers control over publication.

Build a refund approval workflow in n8n and Stripe that shows reviewers the exact action, expires old approvals and tracks refunds through to completion.