?
Solved

Apache log file rotation

Posted on 2011-03-13
4
Medium Priority
?
712 Views
Last Modified: 2012-05-11
Hi

I need to rotate logs on my apache webserver once every day. I am not a big CentOS user, so followed the examples in the docs for piped logs, but started to receive an error because bin/rotatelogs did not exist. It said that it was included in the distro, but not on mine!

We used this line in the httpd.conf, after following the docs:
CustomLog "|bin/rotatelogs /var/log/httpd/access_log.%Y-%m-%d 86400" combined

Open in new window


Can anyone help me resolve this - I am happy to use another solution to rotate logs, but you must include step by step instructions for installation.

The must have factor in this is the files must be identifiable by date in the file name. We use them to parse stats on a monthly basis.

Thanks!
0
Comment
Question by:mmc98dl1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 1000 total points
ID: 35120343
0
 
LVL 12

Author Comment

by:mmc98dl1
ID: 35126675
ok so that seems to be a good tool.

It doesnt describe how I can make the resulting file name show a date, it only states how I can get a .x to signify the number in the rotation.

I need a file name like yyyy-mm-dd.log

How would I do this?
0
 
LVL 12

Author Closing Comment

by:mmc98dl1
ID: 35127065
I noted further to this that a flag of dateext exists, and this creates the file with yyyymmdd - just what I need.

man logrotate was really helpful

Thanks for the lead
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 35127231
Welcome
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question