Friday, May 17, 2019

Common Debugging Methods In Linux


The top 6 common debugging methods in Linux.

( 1 ) Increase logging verbosity
As usual, in Linux systems we could look out for errors/warnings/info related messages in "/var/log/messages" file. By default only ‘info’ ( information) and above messages gets logged in to this file, so to increase this logging verbosity one could edit the configuration line of "/var/log/messages" in "/etc/rsyslog.conf" file.


Change this line from :
*.info;mail.none;authpriv.none;cron.none                /var/log/messages

to
*.debug;mail.none;authpriv.none;cron.none                /var/log/messages


After making this change, save and exit the file. Restart the “rsyslogd” service ( 'systemctl restart rsyslogd.service' or 'service rsyslogd restart' in case of RHEL6.x and older) to make the changes come into effect. NOTE: Keep in mind that this would generate a lot of logs and "/var" may get filled up fast, so after the diagnosis make sure to revert the changes.