You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Jason M. Kuhlman" <jk...@oglecounty.org> on 2003/06/02 13:47:18 UTC

[users@httpd] Dates in rotated Logs

Looking in the documentation on Transferlog with Rotate log, it says that it
stamps the log file with the system time when the file was started, like
access.1045094400.  Is there a way to have apache rotate logfiles with
date/time stamps in the file name, like access200305029.log?   

Jason M. Kuhlman



---------------------------------------------------------------------
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


Re: [users@httpd] Dates in rotated Logs

Posted by Mystery Admin <my...@whatfantasiesmaycome.com>.
On Mon, 2 Jun 2003 at 07:33:51, Rich Bowen wrote:

> On Mon, 2 Jun 2003, Jason M. Kuhlman wrote:
> 
> > Looking in the documentation on Transferlog with Rotate log, it says that
> it
> > stamps the log file with the system time when the file was started, like
> > access.1045094400.  Is there a way to have apache rotate logfiles with
> > date/time stamps in the file name, like access200305029.log?
> 
> Not using that tool, unless you want to modify the source and rebuild
> it. This is fairly frequently suggested, and there are several
> third-party tools that do similar things. Chronolog, by Andrew Ford, is
> one example of such a tool. Also, there's a Perl module called
> Logfile::Rotate, which is what I use to rotate my log files.

I use Cronolog and it works great.  My logs rotate daily for all of my sites and
they have a {log name}.%Y.%M.%D format (accessLog.2003.06.02, for example).

Peace...

Tom

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


Re: [users@httpd] Cronolog on OS X ?

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.

On Fri, 18 Jul 2003, Jim Sheffer wrote:

> I must be looking at the wrong man pages- I don't see it...
> Here's what I see:
>
> ...TransferLog "|rotatelogs /path/to/logs/access_log 86400"

Perhaps a bit further below is where you want to read:


OPTIONS
       logfile
              The path plus basename of the logfile.  If  logfile
              includes  any % characters, it is treated as a for-
              mat string for strftime(3).  Otherwise, the  suffix
              .nnnn  is  automatically  added  and is the time at
              which the logfile was created.

The full page is below. The trick to not get it to restart a new log on
each restart is to make sure you pick the right granularity of time.

Dw.

[burly:~] dirkx% uname -a
Darwin burly.leiden.webweaving.org 6.6 Darwin Kernel Version 6.6: Thu May  1 21:48:54 PDT 2003; root:xnu/xnu-344.34.obj~1/RELEASE_PPC  Power Macintosh powerpc
[burly:~] dirkx% man rotatelogs
rotatelogs(8)                                       rotatelogs(8)

NAME
       rotatelogs - rotate Apache logs without having to kill the
       server

SYNOPSIS
       rotatelogs logfile rotationtime [offset]

DESCRIPTION
       rotatelogs is a simple program for use in conjunction with
       Apache's  piped  logfile  feature  which  can be used like
       this:

          TransferLog  "|   rotatelogs   /path/to/logs/access_log
       86400"

       This creates the files /path/to/logs/access_log.nnnn where
       nnnn is the system time at which the log nominally  starts
       (this time will always be a multiple of the rotation time,
       so you can synchronize cron scripts with it).  At the  end
       of  each  rotation time (here after 24 hours) a new log is
       started.

OPTIONS
       logfile
              The path plus basename of the logfile.  If  logfile
              includes  any % characters, it is treated as a for-
              mat string for strftime(3).  Otherwise, the  suffix
              .nnnn  is  automatically  added  and is the time at
              which the logfile was created.

       rotationtime
              The rotation time in seconds.

       offset The number of minutes offset from UTC.  If omitted,
              zero  is  assumed and UTC is used.  For example, to
              use local time in the zone UTC -5 hours, specify  a
              value of -300 for this argument.

SEE ALSO
       httpd(8)

                            March 2001              rotatelogs(8)



---------------------------------------------------------------------
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


Re: [users@httpd] Cronolog on OS X ?

Posted by Jim Sheffer <ji...@blueworld.com>.
On 7/18/03 12:12 PM, "Dirk-Willem van Gulik" <di...@webweaving.org> rambled
on about the following:

> 
> 
> On Fri, 18 Jul 2003, Jim Sheffer wrote:
> 
>> Rotatelogs is currently being used.  The problems I have are twofold.
>> 
>> 1. The logname is cryptic- I know it is chronological, but it is still
>> harder to read than a dated logfile. More importantly, it uses a format of
>> access_log.********
> 
> Do a man rotatelogs ...
> 
> -> the logfile name can be modified and be things like
> 
> /var/log/%Y%m%d%H%M.log
> 
> Or whatever strftime(3) supports.

I must be looking at the wrong man pages- I don't see it...
Here's what I see:

...TransferLog "|rotatelogs /path/to/logs/access_log 86400"
This creates the files  /path/to/logs/access_log.nnnn  where
nnnn  is  the  system time at which the log nominally starts

... rotationtime The rotation time in seconds.

... The path plus basename of the logfile. The suffix .nnnn
          is automatically added.

I had also read the following post to the list... So now I'm confused...

>> Looking in the documentation on Transferlog with Rotate log, it says that it
>> stamps the log file with the system time when the file was started, like
>> access.1045094400.  Is there a way to have apache rotate logfiles with
>> date/time stamps in the file name, like access200305029.log?

>Not using that tool, unless you want to modify the source and rebuild
>it. This is fairly frequently suggested, and there are several
>third-party tools that do similar things. Chronolog, by Andrew Ford, is
>one example of such a tool. Also, there's a Perl module called
>Logfile::Rotate, which is what I use to rotate my log files.


Jim Sheffer

Blue World Communications  http://www.blueworld.com
phone: 425-646-0288  jimsheffer@blueworld.com

> 
>> 2. It seems to restart a new log file anytime the server is restarted.
> 
> If you make sure it does not contain the time in _seconds_ or some other
> small granule then it will not reopen a 'new' file. See the man page.
> 
> Dw.


---------------------------------------------------------------------
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


Re: [users@httpd] Cronolog on OS X ?

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.

On Fri, 18 Jul 2003, Jim Sheffer wrote:

> Rotatelogs is currently being used.  The problems I have are twofold.
>
> 1. The logname is cryptic- I know it is chronological, but it is still
> harder to read than a dated logfile. More importantly, it uses a format of
> access_log.********

Do a man rotatelogs ...

-> the logfile name can be modified and be things like

	/var/log/%Y%m%d%H%M.log

Or whatever strftime(3) supports.

> 2. It seems to restart a new log file anytime the server is restarted.

If you make sure it does not contain the time in _seconds_ or some other
small granule then it will not reopen a 'new' file. See the man page.

Dw.



---------------------------------------------------------------------
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


Re: [users@httpd] Cronolog on OS X ?

Posted by Jim Sheffer <ji...@blueworld.com>.
Rotatelogs is currently being used.  The problems I have are twofold.

1. The logname is cryptic- I know it is chronological, but it is still
harder to read than a dated logfile. More importantly, it uses a format of
access_log.********
Because of this, I need to change the name of the log file so that it can be
recognized by our log analysis program.  Also, Cronolog will allow me to
name the logfile with the sitename, so I could keep multiple logs in one
folder in the format of : access_log-site1-07-15-2003.log &
access_log-site2-07-15-2003.log

Assuming I am correct in this, this would make things a lot easier fro me to
grab all the logs out of one folder and move them easily to the machine
processing the logfiles.

2. It seems to restart a new log file anytime the server is restarted.  I
don't remember this happening with the access log when I wasn't rolling it.
I don't know if cronolog will solve this, and it is not a terribly big issue
anyway.


Jim Sheffer

Blue World Communications  http://www.blueworld.com
phone: 425-646-0288  jimsheffer@blueworld.com


On 7/18/03 11:53 AM, "Dirk-Willem van Gulik" <di...@webweaving.org> rambled
on about the following:

> 
> On Fri, 18 Jul 2003, Jim Sheffer wrote:
> 
>> It rotates apache logs with dates in the log name, basically.  Exactly what
>> I need, but I keep getting a "configuration broken" error when trying to
>> restart apache.
> 
> And you cannot use the 'rotatelogs' of apache - which comes on OSX ? Just
> do 'man rotatelogs' from the Terminal.app.
> 
> Dw
> 
> 
> ---------------------------------------------------------------------
> 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
> 


---------------------------------------------------------------------
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


Re: [users@httpd] Cronolog on OS X ?

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.
On Fri, 18 Jul 2003, Jim Sheffer wrote:

> It rotates apache logs with dates in the log name, basically.  Exactly what
> I need, but I keep getting a "configuration broken" error when trying to
> restart apache.

And you cannot use the 'rotatelogs' of apache - which comes on OSX ? Just
do 'man rotatelogs' from the Terminal.app.

Dw


---------------------------------------------------------------------
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


Re: [users@httpd] Cronolog on OS X ?

Posted by Jim Sheffer <ji...@blueworld.com>.
It rotates apache logs with dates in the log name, basically.  Exactly what
I need, but I keep getting a "configuration broken" error when trying to
restart apache.

Jim


On 7/18/03 11:39 AM, "Michael Zwicker" <ma...@ns.sympatico.ca> rambled on
about the following:

> I have OS X, but what is this Cronolog?
> 
> 
> Mike
> 
> 
> ---------------------------------------------------------------------
> 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
> 


---------------------------------------------------------------------
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


Re: [users@httpd] Cronolog on OS X ?

Posted by Michael Zwicker <ma...@ns.sympatico.ca>.
I have OS X, but what is this Cronolog?


Mike


---------------------------------------------------------------------
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


[users@httpd] Cronolog on OS X ?

Posted by Jim Sheffer <ji...@blueworld.com>.
Anyone out there using cronolog on OS X ?  I'm having a hell of a time to
get it to work.

Any help would be appreciated :)

Thanks!

Jim


---------------------------------------------------------------------
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


Re: [users@httpd] Dates in rotated Logs

Posted by Rich Bowen <rb...@rcbowen.com>.
On Mon, 2 Jun 2003, Jason M. Kuhlman wrote:

> Looking in the documentation on Transferlog with Rotate log, it says that it
> stamps the log file with the system time when the file was started, like
> access.1045094400.  Is there a way to have apache rotate logfiles with
> date/time stamps in the file name, like access200305029.log?

Not using that tool, unless you want to modify the source and rebuild
it. This is fairly frequently suggested, and there are several
third-party tools that do similar things. Chronolog, by Andrew Ford, is
one example of such a tool. Also, there's a Perl module called
Logfile::Rotate, which is what I use to rotate my log files.

-- 
Rich Bowen - rbowen@rcbowen.com
As we trace our own few circles around the sun
We get it backwards and our seven years go by like one
	Dog Years (Rush - Test for Echo - 1999)

---------------------------------------------------------------------
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