System Logs and Troubleshooting

Inspect system logs, investigate errors and troubleshoot MocaccinoOS using journalctl.

System Logs and Troubleshooting

MocaccinoOS uses systemd-journald to collect and store system logs.

These logs contain information about system startup, services, kernel messages, hardware and applications. They are particularly useful when diagnosing problems or investigating unexpected behaviour.

The journalctl command provides access to the systemd journal.

Viewing system logs

To display all available journal entries:

1
$ journalctl

The output is displayed using a pager. Press q to exit.

To display only the most recent entries:

1
$ journalctl -n 50

To follow new log messages in real time:

1
$ journalctl -f

Press Ctrl+C to stop following the logs.

Viewing logs from the current boot

To display messages from the current boot:

1
$ journalctl -b

To display logs from the previous boot:

1
$ journalctl -b -1

To list recorded boots:

1
$ journalctl --list-boots

This is especially useful when investigating problems that occurred before the system was restarted.

Previous boot logs are only available if the journal has retained them.

Filtering logs by priority

Journal entries have different priority levels.

The available priorities are:

Priority Description
0 Emergency
1 Alert
2 Critical
3 Error
4 Warning
5 Notice
6 Informational
7 Debug

To display only errors and more severe messages:

1
$ journalctl -p err

To display warnings and more severe messages:

1
$ journalctl -p warning

To display errors from the current boot:

1
$ journalctl -b -p err

Viewing logs from a specific service

You can filter journal entries by systemd service.

For example, to inspect NetworkManager:

1
$ journalctl -u NetworkManager

To display the most recent 50 entries:

1
$ journalctl -u NetworkManager -n 50

To follow the service logs in real time:

1
$ journalctl -u NetworkManager -f

Replace NetworkManager with the name of the service you want to investigate.

Viewing kernel messages

Kernel messages can provide useful information about hardware, drivers and device initialization.

To display kernel messages:

1
$ journalctl -k

To display kernel messages from the current boot:

1
$ journalctl -k -b

To display only kernel errors:

1
$ journalctl -k -p err

These commands are useful when investigating problems with graphics cards, network adapters, storage devices and other hardware.

Viewing logs from a specific time period

You can filter journal entries using --since and --until.

To display messages from the last hour:

1
$ journalctl --since "1 hour ago"

To display messages from today:

1
$ journalctl --since today

To specify a time range:

1
$ journalctl --since "2026-11-29 08:00:00" --until "2026-11-29 09:00:00"

You can combine time filters with service filters:

1
$ journalctl -u NetworkManager --since "30 minutes ago"

Investigating failed services

If a service fails to start, you can first list failed units:

1
$ systemctl --failed

Then inspect the service:

1
$ systemctl status service-name

To retrieve its detailed logs:

1
$ journalctl -u service-name -b

This combination is often enough to identify missing dependencies, configuration errors or permission problems.

For more information about managing services, see the Managing System Services documentation.

Checking disk usage of the journal

The systemd journal can occupy disk space over time.

To check how much space the journal currently uses:

1
$ journalctl --disk-usage

To remove archived journal entries older than 30 days:

1
$ sudo journalctl --vacuum-time=30d

You can also limit the total size of archived journal files:

1
$ sudo journalctl --vacuum-size=500M

Note: Vacuum operations remove archived journal files. They do not remove entries from the currently active journal file.

Exporting logs for troubleshooting

When reporting a problem, it can be useful to provide the relevant log output.

For example, to save errors from the current boot to a text file:

1
$ journalctl -b -p err > system-errors.txt

To export the logs of a specific service:

1
$ journalctl -u NetworkManager -b > networkmanager.log

You can then attach these files to a support request.

Privacy note: System logs may contain usernames, hostnames, IP addresses, device identifiers and other potentially sensitive information. Review log files before sharing them publicly.

Additional information

For more information about system logging, consult the following manual pages:

1
2
3
$ man journalctl
$ man systemd-journald
$ man journald.conf

You can also consult the following resources:

Last modified November 29, 2026: Update SFTP (f553589)