Re: [OT] Re: Rotating Apache logs
You may be aware of this, but cronolog is another option: http://www.ford-mason.co.uk/resources/cronolog/ Mike - Original Message - From: "Steve Reppucci" <[EMAIL PROTECTED]> To: "Terry Newnham" <[EMAIL PROTECTED]> Cc: "mod_perl list" <[EMAIL PROTECTED]> Sent: Thursday, February 22, 2001 2:11 PM Subject: [OT] Re: Rotating Apache logs > > This is definitely off topic for this list, however... > > I'm not exactly sure what you're asking here, but if what you're asking is > "how do I rotate logfiles without doing a hard stop/start cycle?", then > the answer is (from the command line...) rename the open logfiles, then > send the server either a SIGHUP or a SIGUSR1, which will cause it to > reopen its logfiles. > > SIGHUP does it "forcefully" (existing requests will aborted), while > SIGUSR1 does it "gracefully", allowing each child server currently > handling requests to complete the request before restarting it. > > If you use the 'apachectl' control script included in the apache > distribution, these options correspond to 'apachectl restart' and > 'apachectl graceful', respectively (although, if I remember right, the > 'graceful' option wasn't added until around release 1.3.0). > > So, something like this is what you want to do: > > root# cd /usr/local/apache > root# mv logs/access_log logs/access_log.21-feb-2001 > root# mv logs/error_log logs/error_log.21-feb-2001 > root# ./apachectl graceful > > At this point, new logs will be opened in the logs directory, and you can > safely do whatever (gzip, archive, analyze, etc...) you want with the > rotated logs. > > HTH, > > > On Thu, 22 Feb 2001, Terry Newnham wrote: > > > I've found out how to edit httpd.conf so that it will rotate the error > > and access logs. But you have to restart apache to read that which I'd > > rather not do. Is there a command-line use or the rotatelogs by means of > > which you can rotate the logs on the fly ? > > =-=-=-=-=-=-=-=-=-=- My God! What have I done? -=-=-=-=-=-=-=-=-=-= > Steve Reppucci [EMAIL PROTECTED] | > Logical Choice Software http://logsoft.com/ | > >
[OT] Re: Rotating Apache logs
This is definitely off topic for this list, however... I'm not exactly sure what you're asking here, but if what you're asking is "how do I rotate logfiles without doing a hard stop/start cycle?", then the answer is (from the command line...) rename the open logfiles, then send the server either a SIGHUP or a SIGUSR1, which will cause it to reopen its logfiles. SIGHUP does it "forcefully" (existing requests will aborted), while SIGUSR1 does it "gracefully", allowing each child server currently handling requests to complete the request before restarting it. If you use the 'apachectl' control script included in the apache distribution, these options correspond to 'apachectl restart' and 'apachectl graceful', respectively (although, if I remember right, the 'graceful' option wasn't added until around release 1.3.0). So, something like this is what you want to do: root# cd /usr/local/apache root# mv logs/access_log logs/access_log.21-feb-2001 root# mv logs/error_log logs/error_log.21-feb-2001 root# ./apachectl graceful At this point, new logs will be opened in the logs directory, and you can safely do whatever (gzip, archive, analyze, etc...) you want with the rotated logs. HTH, On Thu, 22 Feb 2001, Terry Newnham wrote: > I've found out how to edit httpd.conf so that it will rotate the error > and access logs. But you have to restart apache to read that which I'd > rather not do. Is there a command-line use or the rotatelogs by means of > which you can rotate the logs on the fly ? =-=-=-=-=-=-=-=-=-=- My God! What have I done? -=-=-=-=-=-=-=-=-=-= Steve Reppucci [EMAIL PROTECTED] | Logical Choice Software http://logsoft.com/ |
Re: Rotating Apache logs
Terry Newnham wrote: > I've found out how to edit httpd.conf so that it will rotate the error > and access logs. But you have to restart apache to read that which I'd > rather not do. Is there a command-line use or the rotatelogs by means of > which you can rotate the logs on the fly ? On log rotation see http://www.modperl.com/perl_conference/
Re: Rotating Apache logs
this is off-topic, coz logrotate should do it. man logrotate. rgds, Edwin Terry Newnham wrote: > > Hi > > I've found out how to edit httpd.conf so that it will rotate the error > and access logs. But you have to restart apache to read that which I'd > rather not do. Is there a command-line use or the rotatelogs by means of > which you can rotate the logs on the fly ? > > Terry
Re: Rotating Apache logs
Hi all, On Thu, 22 Feb 2001, Terry Newnham wrote: > Is there a command-line use or the rotatelogs by means of > which you can rotate the logs on the fly ? Your logs can be piped through a program so you can do anything you like with them, on the fly. For example (from http://perl.apache.org/guide): LogFormat "%h %l %u %t \"%r\" %>s %b" common CustomLog "| /usr/local/apache/bin/syslogger.pl hostnameX" common Note that this particular approach is said to be slow, but there are other ways of doing it. 73, Ged.
Rotating Apache logs
Hi I've found out how to edit httpd.conf so that it will rotate the error and access logs. But you have to restart apache to read that which I'd rather not do. Is there a command-line use or the rotatelogs by means of which you can rotate the logs on the fly ? Terry