Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

apache, linux, logrotate & naming of rotated logfiles

Posted on 2002-05-07
5
Medium Priority
?
317 Views
Last Modified: 2008-02-26
Hi,

I want to have logrotate name my rotated apache logs with today's date (e.g., access_log.05062002.gz instead of access_log.1.gz).

I am sure some combination of things in /etc/logrotate.d/apache will do the trick, either pre-rotation or post-rotation, etc.  Can anyone help?

TIA,

-RD


0
Comment
Question by:rdefuria
  • 3
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
samri earned 100 total points
ID: 6995582
I think the post-rotation would be the options.

What you need to do is to rename the logfile from access_log.1.gz to access_log.ddmmyyyy.gz

0
 
LVL 2

Expert Comment

by:prokni
ID: 6999940
I am using cronolog and it works really good.
0
 
LVL 15

Expert Comment

by:samri
ID: 7000361
rdefuria,

prokni is correct, cronolog would do it very nicely
http://www.cronolog.org/features.html

However you would need to get cronolog installled and configure.  I tried on Win2K (struggling for hours already - haven't got it to work).

Other options that could be used:
http://httpd.apache.org/docs/logs.html

Anyhow, these would requires the apache-service to be restarted (from cron maybe) for the log rotation to work.

I would personally go for logrotate, and write add the renaming part in post-rotate section. (since this is my proposition).  Cronolog is good too.
0
 
LVL 2

Expert Comment

by:prokni
ID: 7000553
I installed it on sun Solaris 2.8 very easily.
0
 
LVL 15

Expert Comment

by:samri
ID: 7000585
I guess any other OS but Windoze should be pretty straight forward :(

Btw, what happened to Tia. ?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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 …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month6 days, 15 hours left to enroll

782 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