• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

apache, linux, logrotate & naming of rotated logfiles

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
rdefuria
Asked:
rdefuria
  • 3
  • 2
1 Solution
 
samriCommented:
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
 
prokniCommented:
I am using cronolog and it works really good.
0
 
samriCommented:
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
 
prokniCommented:
I installed it on sun Solaris 2.8 very easily.
0
 
samriCommented:
I guess any other OS but Windoze should be pretty straight forward :(

Btw, what happened to Tia. ?
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now