Usage hints / HowTo¶
This chapter contains several documents describing the usage of DietPi.
How to use the logging mechanism¶
DietPi uses systemd as system and service manager, which includes the
systemd-journald logging daemon. An additional syslog daemon, like
rsyslog, is not required and hence not pre-installed on DietPi. The basic command to access
systemd-journald logs is
Logging basic output
journalctl prints out all logging messages stored in the system.
Each line shows:
<timestamp> <hostname> <process name>[PID]: <log message>
The following screenshot shows the logging of the boot process (of a DietPi virtual machine). You can see the various fields (timestamp, hostname, etc.) in the log entries:
Logging output filtering options
Some of the options are described in the following table.
More detailed options may be studied in the man pages of
|Displays messages of the given unit|
|Displays messages of process with PID equals to <process_id>|
|Displays list in reverse order, i.e. newest messages first|
|Displays the tail of the log message list and shows new entries live|
|Displays messages since the last boot (i.e. no older messages). See also option |
|Displays kernel messages|
|Displays messages with the given priority. PRIORITY may be |
|Displays additional meta data|
|Displays the amount of disk space used by the logging messages|
|Filters log messages (filtering with |
In the software package descriptions, sometimes there is a tab called “View Logs”. This gives a
jounalctl -u UNITNAME command example how to filter the logging messages of a given software package.
Example: See tab “View logs” of Unbound. It gives:
journalctl -u unbound.
As described in the chapter Log system choices, DietPi has several options how the logging system operates. Especially the log history, the memory consumption and the frequency of SD card write accesses varies.
Find and set the options which fit to your demands, it is also an option to change the logging to examine some problems.
|Log option||location||log depth||log persistence|
|DietPi-RAMlog #1||RAM||last hour||volatile, i.e. not saved to disk|
|DietPi-RAMlog #2||RAM||long term||stored, i.e. hourly saved to disk|
|Full logging||disk||long term||stored, i.e. immediately saved to disk |
(with Rsyslog and Logrotate)