Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Apache log file rotation

Posted on 2011-03-13
4
Medium Priority
?
713 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

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…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month9 days, 10 hours left to enroll

610 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