Mailing List Archive

rotate log file daily
Is there a way to rotate Apache log file daily always at the local time
23:59:59, and to name the old log file as access_log.YYYYMMDD?

Thanks,
Zuwei


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: rotate log file daily [ In reply to ]
Here's what I do and it gives me something like:

access_log.1013126400 for today, which I have no idea how
that translates.

CustomLog "|rotatelogs /home/www/pub/logs/access_log 86400"
common

If anyone knows how to make it come out as zliu1 suggests,
I'd like to know that, better yet I would like to get it
monthly and not daily.


-----Original Message-----
From: zliu1 <zliu1@nd.edu>
To: users@httpd.apache.org
Date: Fri, 8 Feb 2002 10:03:15 -0500 (EST)
Subject: rotate log file daily

>
> Is there a way to rotate Apache log file daily always at
the local time
> 23:59:59, and to name the old log file as
access_log.YYYYMMDD?
>
> Thanks,
> Zuwei
>
>
> ----------------------------------------------------------
-----------
> The official User-To-User support forum of the Apache
HTTP Server
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more
info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-
help@httpd.apache.org
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: rotate log file daily [ In reply to ]
I use cron to run a perl script that processes the log files for all of
my vhosts. The script is based upon the apache doc:
http://httpd.apache.org/docs/logs.html#rotation
I have found that if you use a statistical viewer like webalizer (in my
case), that the apache docs on log rotation works much better than using
the piped logs.

-Kyle

zliu1 wrote:
>
> Is there a way to rotate Apache log file daily always at the local time
> 23:59:59, and to name the old log file as access_log.YYYYMMDD?
>
> Thanks,
> Zuwei
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: rotate log file daily [ In reply to ]
In newer version of Apache, the rotatelogs command can take a new parameter
with is the offset of your Time Zone to GMT time zone.

TransferLog "|/opt/apache/bin/rotatelogs
/opt/apache/logs/httpd_access_log.%y%m%d%H 3600 -420"

another way is cronolog
Gilles

> -----Original Message-----
> From: Vernon A Webb [mailto:VernMan@net-nation.com]
> Sent: Friday, February 08, 2002 7:06 AM
> To: users@httpd.apache.org
> Subject: Re: rotate log file daily
>
>
> Here's what I do and it gives me something like:
>
> access_log.1013126400 for today, which I have no idea how
> that translates.
>
> CustomLog "|rotatelogs /home/www/pub/logs/access_log 86400"
> common
>
> If anyone knows how to make it come out as zliu1 suggests,
> I'd like to know that, better yet I would like to get it
> monthly and not daily.
>
>
> -----Original Message-----
> From: zliu1 <zliu1@nd.edu>
> To: users@httpd.apache.org
> Date: Fri, 8 Feb 2002 10:03:15 -0500 (EST)
> Subject: rotate log file daily
>
> >
> > Is there a way to rotate Apache log file daily always at
> the local time
> > 23:59:59, and to name the old log file as
> access_log.YYYYMMDD?
> >
> > Thanks,
> > Zuwei
> >
> >
> > ----------------------------------------------------------
> -----------
> > The official User-To-User support forum of the Apache
> HTTP Server
> > Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more
> info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-
> help@httpd.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: rotate log file daily [ In reply to ]
On Fri, 2002-02-08 at 07:03, zliu1 wrote:
> Is there a way to rotate Apache log file daily always at the local time
> 23:59:59, and to name the old log file as access_log.YYYYMMDD?

you want logrotate(8), which is included with most linux distros and is
probably ported to other unices as well.

-jon

--
jon@divisionbyzero.com || www.divisionbyzero.com
gpg key: www.divisionbyzero.com/pubkey.asc
think i have a virus?: www.divisionbyzero.com/pgp.html
"You are in a twisty little maze of Sendmail rules, all confusing."