Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


apache, linux, logrotate & naming of rotated logfiles

Posted on 2002-05-07
Medium Priority
Last Modified: 2008-02-26

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?



Question by:rdefuria
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
  • 3
  • 2
LVL 15

Accepted Solution

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


Expert Comment

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

Expert Comment

ID: 7000361

prokni is correct, cronolog would do it very nicely

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:

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.

Expert Comment

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

Expert Comment

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

Btw, what happened to Tia. ?

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
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 this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

718 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