logs Management in RHEL7
What is Logs In Operating System .
Log fies is very useful when we are trying to troubleshoot any problem in system as it’s contain Message about the system Includes Kernel,Services and application which Is running on it .
In Redhat-7 logs controlled by Rsyslogd Deamon which is enhanced replacement of Syslogd .
Below are default location of logs ,we can change it to cutom location by modifying the file .
#vi /etc/rsyslog.conf (log management file )
/var/log/ (All log files stored inside this )
Info : there is 8 types of logs managed in linux RHEL7
Log Priorities Priority Codes
1 Emerg > 0 (Emergency)
2 Alert > 1 (Alert log)
3 Crit > 2 (Critical)
4 Err > 3 (Error)
5 Warning > 4 (Warning)
6 Notice > 5 (Notice)
7 info > 6 (info)
8 debug > 7 (Debugging)
Below Are files for manage the logs .
#vi /var/messages (System logs)
#vi /var/log/boot.log (OS boot logs)
#vi /var/log/secure (Authentication logs)
#vi /var/log/maillog (Mail logs)
#vi /var/log/cron (Cron job logs)
Logrotate:- Logrotate is a inbuilt utility in Linux which automatically mange the log Backup by default weekly however we can change in to Montly,Yearly or Size wise as per our requirement .
Info : Logrotate Script run daily which by scheduled in cron.daily
#ls /etc/cron.daily ( daily cron files list )
#vi /etc/logrotate.conf ( Logrotate configuration file )
/var/log/logfile-YYYYMMDD (Example of backup file )
#tail –f /var/log/messages ( for see the system logs latest) s–f (frequently refresh)