System Logs and Troubleshooting
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:
|
|
The output is displayed using a pager. Press q to exit.
To display only the most recent entries:
|
|
To follow new log messages in real time:
|
|
Press Ctrl+C to stop following the logs.
Viewing logs from the current boot
To display messages from the current boot:
|
|
To display logs from the previous boot:
|
|
To list recorded 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:
|
|
To display warnings and more severe messages:
|
|
To display errors from the current boot:
|
|
Viewing logs from a specific service
You can filter journal entries by systemd service.
For example, to inspect NetworkManager:
|
|
To display the most recent 50 entries:
|
|
To follow the service logs in real time:
|
|
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:
|
|
To display kernel messages from the current boot:
|
|
To display only kernel errors:
|
|
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:
|
|
To display messages from today:
|
|
To specify a time range:
|
|
You can combine time filters with service filters:
|
|
Investigating failed services
If a service fails to start, you can first list failed units:
|
|
Then inspect the service:
|
|
To retrieve its detailed logs:
|
|
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:
|
|
To remove archived journal entries older than 30 days:
|
|
You can also limit the total size of archived journal files:
|
|
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:
|
|
To export the logs of a specific service:
|
|
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:
|
|
You can also consult the following resources: