Portal Home > Knowledgebase > Articles Database > huge apache logs


huge apache logs




Posted by WebPerfection, 02-03-2008, 04:44 PM
I'm sure this question has been asked before, but I'm looking for a nice and simply way of breaking up log files into smaller chunks. I've been running apache2 on a VPS for the past few months and one of the access.log files is now 700mb big... bit of a waste of space. I'm currently just doing: CustomLog /var/www/logs/domain.com/access.log combined ErrorLog /var/www/logs/domain.com/error.log In my apache config. Is there any easy way of telling apache to just keep the last week or months worth of logs? Thanks, Jack

Posted by Steve_Arm, 02-03-2008, 04:57 PM
Read the newsyslog.conf manual page, it says how to configure your logs to rotate whenever you want or according to size and archive them.

Posted by WebHostingNeeds, 02-03-2008, 06:04 PM
logrotate.conf if you are using linux.

Posted by Michael Freyman, 02-03-2008, 07:11 PM
I have used cronolog in the past to rotate apaches logs. It worked pretty good for me. Mike

Posted by david510, 02-03-2008, 10:33 PM
This should help you. http://www.scriptinstallation.in/logrotate.html

Posted by WebPerfection, 02-04-2008, 09:44 AM
Thanks, that's perfect. Only question is, can you set it up to scan directories recursively? For example, my logs are currently set to be in /var/www/domain1-10.com/error.log so each domain has it's own directory. I really don't want to have to add a new entry to logrotate.conf every time I add a new domain to the server. If there is no easy solution I'll just set the apache config to save all logs in the same dir as domain1.com.error.log and point logrotate to that dir, but it's not as clean

Posted by WebPerfection, 02-04-2008, 06:17 PM
Ah never mind, I just stuck all the log files in the same directory for simplicity

Posted by david510, 02-04-2008, 10:56 PM
You may specify as below. /var/www/domain1-10.com/*



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Reselling 'the cloud' (Views: 541)