How to Change Log Level to Debug in Ubuntu
This article provides a concise guide on enabling debug logging within the Ubuntu operating system. It outlines the specific commands and configuration adjustments required to increase log verbosity for effective system troubleshooting and error analysis.
To immediately change the systemd manager log level to debug, run the following command in your terminal:
sudo systemctl log-level debugThis command takes effect instantly without requiring a reboot.
However, this setting primarily applies to the systemd daemon itself.
For persistent system-wide debug logging via the journal, you must
modify the configuration file. Open
/etc/systemd/journald.conf using a text editor like
nano:
sudo nano /etc/systemd/journald.confLocate the line starting with #LogLevel= and change it
to:
LogLevel=debug
Remove the hash symbol (#) to uncomment the line. Save
the file and restart the systemd journal service to apply the
changes:
sudo systemctl restart systemd-journaldTo view the detailed debug logs after enabling these settings, use the journalctl command:
journalctl -p debugRemember to revert these changes after troubleshooting, as debug logging can consume significant disk space and impact system performance.