Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Apache Log Management
PostPosted: Sun Oct 21, 2012 1:05 pm 
Offline
Senior Newbie

Joined: Wed May 16, 2012 1:51 pm
Posts: 12
What's the simplest way (other than not logging in the first place) to keep apache access log files from growing to huge sizes?

Ideally I'd like to keep some sort of log history -- at least 24 hours. But I don't want to install anything complicated. Using a basic LAMP setup. Probably should do something similar for php logs also...

??


Top
   
PostPosted: Sun Oct 21, 2012 1:06 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Install log rotate it'll rotate your logs automatically.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Sun Oct 21, 2012 1:43 pm 
Offline
Senior Newbie

Joined: Wed May 16, 2012 1:51 pm
Posts: 12
obs wrote:
Install log rotate it'll rotate your logs automatically.


Do you mean this: http://httpd.apache.org/docs/2.2/progra ... elogs.html


Top
   
PostPosted: Sun Oct 21, 2012 2:42 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Nope this http://linuxcommand.org/man_pages/logrotate8.html, your distro will have it as a package try apt-get install logrotate for debian/ubuntu

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Mon Oct 22, 2012 11:24 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
Odd, normally most distributions will automatically install/configure logrotate when you install any package that produces logs (like apache).


Top
   
PostPosted: Tue Oct 23, 2012 10:11 pm 
Offline
Senior Newbie

Joined: Wed May 16, 2012 1:51 pm
Posts: 12
On the subject...if I just do nothing and let the log file grow and grow, is there a limit (ie file size) beyond which there would be some kind of performance issue?


Top
   
PostPosted: Tue Oct 23, 2012 11:24 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Well, if you're using an ext3 or ext4 filesystem, I think there's a file size limit of 2^24 blocks (16GB-2TB depending on block size). Other than this, writing the log shouldn't be much of a problem, but moving/searching/analyzing a huge file can take a long time. Another benefit of logrotate is that it can automatically compress older log files for you.


Top
   
PostPosted: Wed Oct 24, 2012 6:25 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
A bigger problem is that you'll eventually run out of disk space. (Keep in mind that there are many other log files on your system as well, which logrotate also rotates.)

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
PostPosted: Wed Oct 24, 2012 10:51 am 
Offline
Senior Newbie

Joined: Wed May 16, 2012 1:51 pm
Posts: 12
Thanks for the info -- I'll look into configuring that solution.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group