httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob Coby" <jc...@listingbook.com>
Subject Re: [users@httpd] Question on bin/rotatelogs
Date Thu, 09 Jan 2003 22:10:33 GMT

> So, this will log a 24hour period into that file. What I want to be able
> to do, if possible, is only log one days hits into one log file(example,
> only 09/Jan/2003. The on midnight start to log to a new file for
> 10/Jan/2003).

Couple of options:

1) use logrotate(8) along with a cron that runs at midnight.  Only thing you
need to remember here is that post_rotate you need to sig -HUP to reset
apache, and that whatever_log.1 will be the previous 24hr's log.

2) use a script to cp your log file to log.`date -I`, and then cat /dev/null
> log file to reset it.

1) is more reliable
2) doesn't reset apache and cause your uptime to show < 24hrs or cause
anything to actually reload.  You will lose whatever events happen between
the cp and the cat /dev/null (maybe one or two lines)

-Jacob


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message