System logger
$ journalctl --unit=service
$ journalctl -fu service # To follow log as with tail -f
To limit journal logging:
$ sudo nano /etc/systemd/journald.conf
Uncomment
SystemMaxUse=100M
sudo systemctl restart systemd-journald
$ journalctl --disk-usage # How much space is used
Restart system logging
$ sudo systemctl restart rsyslog # resets /var/log/syslog, deamong.log
$ sudo systemctl restart logrotate
/usr/sbin/logrotate -f /etc/logrotate.d/spaikon # Force run logrotate
Show detailed debug trace
from loguru import logger
@logger.catch # Stack trace
Python logger
When a logger is created, the level is set to NOTSET (which causes all messages to be processed when the logger is the root logger, or delegation to the parent when the logger is a non-root logger).
Note that the root logger is created with level WARNING.
Level |
Numeric value |
---|---|
|
50 |
|
40 |
|
30 |
|
20 |
|
10 |
|
0 |
Documentation: