Rotating Linux Log Files Part 1 syslog. Syslog is the default logging application installed in most Linux distributions. It can be replaced with syslog ng for better functionality, but about this in a future article. As I explained in the introduction, the log files that are managed by syslog are not rotated with logrotate, but by syslog itself. Uncharted 2 Pc Download Completo Restaurant. In the second part I will cover the log files that are handled by logrotate. What files are handled by syslog We can find out what are those files simply by inspecting the syslog configuration file etcsyslog. Lets see how the configuration file looks on a fresh Debian system I have removed most of the comments and kept only the relevant log definitions etcsyslog. Configuration file for syslogd. For more information see syslog. Normally, I would change this and configure based on my preferences, but his is not the point now. As you can see there are various log files that will contain the information specified by the configured facility authpriv, cron, daemon, ftp, kern, lpr, mail, mark, news, security, syslog, user, uucp and local. How are these files rotated As I previously said this is handled by syslog itself, and it is done using 2 cron scripts daily and weekly. The reason for this, is that they will log all the information regardless of the facility, and can become quite quickly very big. LOG devnull. So we can see here that by default my debian system will keep 7 archives of previous logs 7 days. If I would want to change this, then all I have to do is to replace the c 7 parameter with what I need. When does this rotation occur Since it is launched from etccron. AM. weekly rotation handled by etccron. LOG devnull. So by default it will keep 4 archives of old logs without counting the current log the archives will have the extension. If I would want to change this, I would need to modify accordingly the c 4 parameter based on my needs. As seen above in the system crontab, this rotation will take place at 6 4. AMeach Sunday the weekly cronjob. For example, the rotated log files for the messages log file, will look like this varlogmessages. Note On Red. Hat based systems RHEL, Centos, Fedora, etc. I dont see why it could not be implemented if someone wants it. On these operating systems, this is handled also by logrotate as shown in the next part. This covers the basics on how system logs are rotated. In part 2 we will be looking at how application logs are rotated. Go to. Rotating Linux Log Files Part 2 logrotate. Rotating Linux Log Files Introduction. Hackers Manual 2. Power up your linux skills by Alberto Labarga. Hackers Manual 2. Power up your linux skills Published on Jul 2. Install Xen 4 Debian Squeeze Archive© 2017