/[Apache-SVN]/httpd/httpd/trunk/support/rotatelogs.c
ViewVC logotype

Log of /httpd/httpd/trunk/support/rotatelogs.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (annotate)
Sticky Revision:

Revision 807930 - (view) (annotate) - [select for diffs]
Modified Wed Aug 26 08:56:13 2009 UTC (3 months ago) by bjh
File length: 17023 byte(s)
Diff to previous 758929 (colored)
Bring back OS/2 support.
Reverses r758929 with a little bit of conflict resolution.

Revision 758929 - (view) (annotate) - [select for diffs]
Modified Thu Mar 26 23:47:52 2009 UTC (8 months ago) by trawick
File length: 16885 byte(s)
Diff to previous 734973 (colored)
remove OS/2 platform support

Revision 734973 - (view) (annotate) - [select for diffs]
Modified Fri Jan 16 11:08:15 2009 UTC (10 months, 1 week ago) by rjung
File length: 17023 byte(s)
Diff to previous 733532 (colored)
Mostly revert r733493: signal based rotation
for rotatelogs.

Prefer adding reliable piped logs to the error
loggers in httpd, so that one could simply
kill rotatelogs and httpd automatically starts new
instances of all loggers.

Revision 733532 - (view) (annotate) - [select for diffs]
Modified Sun Jan 11 22:52:47 2009 UTC (10 months, 2 weeks ago) by rjung
File length: 18908 byte(s)
Diff to previous 733531 (colored)
Adopt latest changes in usage message.

Revision 733531 - (view) (annotate) - [select for diffs]
Modified Sun Jan 11 22:45:53 2009 UTC (10 months, 2 weeks ago) by rjung
File length: 18912 byte(s)
Diff to previous 733520 (colored)
Allow size units B, K, M, G and combination of
time and size based rotation for rotatelogs.

Revision 733520 - (view) (annotate) - [select for diffs]
Modified Sun Jan 11 21:26:13 2009 UTC (10 months, 2 weeks ago) by rjung
File length: 16055 byte(s)
Diff to previous 733517 (colored)
rotatelogs: Add flag for verbose (debug) output.

Revision 733517 - (view) (annotate) - [select for diffs]
Modified Sun Jan 11 20:58:19 2009 UTC (10 months, 2 weeks ago) by rjung
File length: 14211 byte(s)
Diff to previous 733513 (colored)
More rotatelogs changes:

- checkRotate() notes the reason for rotation
- rename a few variables
- rename some macros and introduce a few more

Revision 733513 - (view) (annotate) - [select for diffs]
Modified Sun Jan 11 20:27:53 2009 UTC (10 months, 2 weeks ago) by rjung
File length: 13958 byte(s)
Diff to previous 733495 (colored)
Minor rotatelogs changes:
- remove 'now' from status struct. We only need it locally.
- add 'static' to function declaration, although the code
  is still in a single file
- change signature of get_now()
- make argument count check easier to understand

Revision 733495 - (view) (annotate) - [select for diffs]
Modified Sun Jan 11 17:48:12 2009 UTC (10 months, 2 weeks ago) by rjung
File length: 14061 byte(s)
Diff to previous 733493 (colored)
Use APR_WANT_STRFUNC and apr_want.h instead
of APR_HAVE_* and system header inclusion.

Revision 733493 - (view) (annotate) - [select for diffs]
Modified Sun Jan 11 17:36:07 2009 UTC (10 months, 2 weeks ago) by rjung
File length: 14114 byte(s)
Diff to previous 733484 (colored)
Allow to trigger rotatelogs log file rotation from
using HUP and INT signals to the rotatelogs process.

This is helpful, when log activity is low, but you want
rotatelogs to close the open log files.

SIGHUP triggers checking the rules given during startup,
SIGINT forces rotate independently form those rules.

When the signal triggers a rotation, the open file
is closed immediately. The new file is opened when
new log data arrives, or in case "-f" was given it
is opened immediately.

Based on my patch in BZ 44427.

Note on Windows: The new functionality is undefined when
SIGHUP or SIGINT are not available. Does the use case
make sense on Windows? If so, which signals should we use?

Revision 733484 - (view) (annotate) - [select for diffs]
Modified Sun Jan 11 16:03:57 2009 UTC (10 months, 2 weeks ago) by rjung
File length: 11973 byte(s)
Diff to previous 733479 (colored)
Addition to r733479 and r733479:

Mainly cleanup plus correct decision in checkRotate()
if status->nLogFD is NULL.

Revision 733479 - (view) (annotate) - [select for diffs]
Modified Sun Jan 11 14:44:51 2009 UTC (10 months, 2 weeks ago) by rjung
File length: 11964 byte(s)
Diff to previous 733476 (colored)
Addition to r744476:

- Fix compilation error
- set correct time when forcing log file open
  on startup

Revision 733476 - (view) (annotate) - [select for diffs]
Modified Sun Jan 11 14:05:39 2009 UTC (10 months, 2 weeks ago) by rjung
File length: 11934 byte(s)
Diff to previous 646845 (colored)
Refactor rotatelogs to allow easier implementation
of signal triggered log rotation.

- move code into new functions checkRotate() and doRotate()
- bundle config data and runtime data in two structs to
  allow easier passing to functions
- Simplify bypass_io logic as a first use case for doRotate
  and rename flag to force_open to reflect the new logic


Revision 646845 - (view) (annotate) - [select for diffs]
Modified Thu Apr 10 15:33:05 2008 UTC (19 months, 2 weeks ago) by trawick
File length: 11488 byte(s)
Diff to previous 632355 (colored)
rotatelogs: Log the current file size and error code/description
when failing to write to the log file. 

Sometimes users have a hard time believing that their little log
file was really big enough to reach quota/filesystem/other limit
back at the time of the error.


Revision 632355 - (view) (annotate) - [select for diffs]
Modified Fri Feb 29 15:32:38 2008 UTC (20 months, 4 weeks ago) by jim
File length: 10534 byte(s)
Diff to previous 615901 (colored)
Add in new option for rotatelogs: -f
This forces rotatelogs to create the logfile as soon
as started not as soon as it sees it's first line
of input.


Revision 615901 - (view) (annotate) - [select for diffs]
Modified Mon Jan 28 14:51:14 2008 UTC (21 months, 4 weeks ago) by rpluem
File length: 9564 byte(s)
Diff to previous 600154 (colored)
* Don't leak memory when reopening the logfile.

PR: 40183
Submitted by: rpluem, Takashi Sato <serai lans-tv.com>
Reviewed by: rpluem

Revision 600154 - (view) (annotate) - [select for diffs]
Modified Sat Dec 1 16:14:21 2007 UTC (23 months, 3 weeks ago) by rpluem
File length: 9236 byte(s)
Diff to previous 596796 (colored)
- when using "-l" reduce two consecutive calls to apr_time_now() to one.
  This will not change the logic if no "-l" gets used, and it will spare
  one call to apr_time_now() in case "-l" gets used and more important
  it gives the code better atomicity, because in fact between the two calls
  there is a slight change of jumping oder the DST boundary

- for historic reasons the same code block is used two times with a
  slightly different way of transforming apr_time_t to int
  (once division by APR_USEC_PER_SEC, once call to apr_time_sec()),
  so let's unify it.

- finally move the block into a function, because it gets used already
  two times.

PR: 44004
Submitted by: Rainer Jung <rainer.jung kippdata.de>
Reviewed by: rpluem

Revision 596796 - (view) (annotate) - [select for diffs]
Modified Tue Nov 20 19:38:13 2007 UTC (2 years ago) by trawick
File length: 9634 byte(s)
Diff to previous 596698 (colored)
Allow local timestamps to be used when rotating based on file size.

IOW, accept and respect either -l or UTC offset when rotating
based on file size.

Revision 596698 - (view) (annotate) - [select for diffs]
Modified Tue Nov 20 14:46:52 2007 UTC (2 years ago) by trawick
File length: 9598 byte(s)
Diff to previous 485828 (colored)
improve command-line parsing

example invocations now flagged as invalid:
  specifying UTC offset with size-based rotation
  specifying -l with size-based rotation
  specifying both -l and UTC offset

range checking of integer parameters not attempted; basic data type issues may need
to be addressed first such as the use of unsigned int for max file size

Revision 485828 - (view) (annotate) - [select for diffs]
Modified Mon Dec 11 19:08:40 2006 UTC (2 years, 11 months ago) by trawick
File length: 8770 byte(s)
Diff to previous 478135 (colored)
increase size of error string buffer passed to apr_strerror();
120 is the size most frequently used in Apache; APR provides no
hints

Revision 478135 - (view) (annotate) - [select for diffs]
Modified Wed Nov 22 11:48:55 2006 UTC (3 years ago) by jorton
File length: 8769 byte(s)
Diff to previous 420983 (colored)
* support/rotatelogs.c (main): Produce useful error message for open()
failures.

PR: 39487

Revision 420983 - (view) (annotate) - [select for diffs]
Modified Tue Jul 11 20:33:53 2006 UTC (3 years, 4 months ago) by fielding
File length: 8468 byte(s)
Diff to previous 395228 (colored)
update license header text

Revision 395228 - (view) (annotate) - [select for diffs]
Modified Wed Apr 19 12:11:27 2006 UTC (3 years, 7 months ago) by colm
File length: 8321 byte(s)
Diff to previous 332306 (colored)
Update the copyright year in all .c, .h and .xml files

Revision 332306 - (view) (annotate) - [select for diffs]
Modified Thu Nov 10 15:11:44 2005 UTC (4 years ago) by jim
File length: 8321 byte(s)
Diff to previous 151408 (colored)
No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines

Revision 151408 - (view) (annotate) - [select for diffs]
Modified Fri Feb 4 20:28:49 2005 UTC (4 years, 9 months ago) by jerenkrantz
File length: 8338 byte(s)
Diff to previous 106103 (colored)
Update copyright year to 2005 and standardize on current copyright owner line.

Revision 106103 - (view) (annotate) - [select for diffs]
Modified Sun Nov 21 18:50:36 2004 UTC (5 years ago) by nd
File length: 8302 byte(s)
Diff to previous 103973 (colored)
general property cleanup

Revision 103973 - (view) (annotate) - [select for diffs]
Modified Wed Jun 16 21:27:06 2004 UTC (5 years, 5 months ago) by coar
File length: 8302 byte(s)
Diff to previous 103945 (colored)
	make the check for GMT offset occur each time through the loop,
	in case a switch between standard and daylight savings time
	occurred.  (correction to previous code courtesy of Uli Zappe.)

PR:		24417
Submitted by:	Uli Zappe <uli ritual.org>

Revision 103945 - (view) (annotate) - [select for diffs]
Modified Mon Jun 14 17:02:54 2004 UTC (5 years, 5 months ago) by coar
File length: 8071 byte(s)
Diff to previous 103921 (colored)
oops; left over from an earlier version

Revision 103921 - (view) (annotate) - [select for diffs]
Modified Fri Jun 11 21:43:58 2004 UTC (5 years, 5 months ago) by coar
File length: 8092 byte(s)
Diff to previous 102619 (colored)
add "-l" option to indicate interval is based on localtime not gmt

Revision 102619 - (view) (annotate) - [select for diffs]
Modified Mon Feb 9 20:40:53 2004 UTC (5 years, 9 months ago) by nd
File length: 7239 byte(s)
Diff to previous 102592 (colored)
fix name of The Apache Software Foundation

Revision 102592 - (view) (annotate) - [select for diffs]
Modified Sun Feb 8 14:14:53 2004 UTC (5 years, 9 months ago) by nd
File length: 7235 byte(s)
Diff to previous 102525 (colored)
fix copyright dates according the first cehck in

Revision 102525 - (view) (annotate) - [select for diffs]
Modified Fri Feb 6 22:58:42 2004 UTC (5 years, 9 months ago) by nd
File length: 7235 byte(s)
Diff to previous 102135 (colored)
apply Apache License, Version 2.0

Revision 102135 - (view) (annotate) - [select for diffs]
Modified Thu Jan 1 13:26:26 2004 UTC (5 years, 10 months ago) by nd
File length: 9261 byte(s)
Diff to previous 98573 (colored)
update license to 2004.

Revision 98573 - (view) (annotate) - [select for diffs]
Modified Mon Feb 3 17:53:28 2003 UTC (6 years, 9 months ago) by nd
File length: 9261 byte(s)
Diff to previous 97570 (colored)
finished that boring job:
update license to 2003.

Happy New Year! ;-))

Revision 97570 - (view) (annotate) - [select for diffs]
Modified Wed Nov 20 00:09:56 2002 UTC (7 years ago) by trawick
File length: 9261 byte(s)
Diff to previous 95675 (colored)
Axe some warnings in rotatelogs which came when the program was
converted to use APR.  The behaviors of apr_file_read() and
apr_file_write() weren't taken completely into account.

But note: In a couple of places the check "nRead < 0" was removed.
          While that is meaningless with APR and hasn't done anything
          useful in a long time, in Apache 1.3 days it was essentially
          a check for read-failed-with-EINTR.  Apparently a rotation
          would occur if the read was interrupted by a signal.  That
          function has been lost with the APR-ization.

PR:              12617

Revision 95675 - (view) (annotate) - [select for diffs]
Modified Fri Jun 14 17:16:03 2002 UTC (7 years, 5 months ago) by wrowe
File length: 9403 byte(s)
Diff to previous 95645 (colored)
  Cleanup some type mismatch emits and consistify to our new apr time helpers

Revision 95645 - (view) (annotate) - [select for diffs]
Modified Thu Jun 13 16:36:54 2002 UTC (7 years, 5 months ago) by rbb
File length: 9400 byte(s)
Diff to previous 95619 (colored)
Just quiet an annoying warning.

Revision 95619 - (view) (annotate) - [select for diffs]
Modified Wed Jun 12 21:46:50 2002 UTC (7 years, 5 months ago) by bnicholes
File length: 9396 byte(s)
Diff to previous 95614 (colored)
Added log rotation based on file size to the RotateLog support utility.

Revision 95614 - (view) (annotate) - [select for diffs]
Modified Tue Jun 11 19:02:02 2002 UTC (7 years, 5 months ago) by bnicholes
File length: 8040 byte(s)
Diff to previous 95613 (colored)
Oops, found another typo

Revision 95613 - (view) (annotate) - [select for diffs]
Modified Tue Jun 11 18:55:37 2002 UTC (7 years, 5 months ago) by bnicholes
File length: 8039 byte(s)
Diff to previous 94633 (colored)
Fixing a typo

Revision 94633 - (view) (annotate) - [select for diffs]
Modified Sat Apr 13 19:35:18 2002 UTC (7 years, 7 months ago) by wrowe
File length: 8038 byte(s)
Diff to previous 94081 (colored)
  Correct const'ness of argv in all support apps, and use the new
  apr_app_initialize over apr_initialize for win32, and other platforms
  that may wish to tweak 'apr-ized' application support (e.g. Netware?)

Revision 94081 - (view) (annotate) - [select for diffs]
Modified Thu Mar 21 10:10:41 2002 UTC (7 years, 8 months ago) by striker
File length: 7997 byte(s)
Diff to previous 93918 (colored)
Update callers of apr_explode_gmt to apr_time_exp_gmt.  The
function was renamed in apr.

Submitted by: Thom May <thom@planetarytramp.net>

Revision 93918 - (view) (annotate) - [select for diffs]
Modified Wed Mar 13 20:48:07 2002 UTC (7 years, 8 months ago) by fielding
File length: 7996 byte(s)
Diff to previous 93733 (colored)
Update our copyright for this year.

Revision 93733 - (view) (annotate) - [select for diffs]
Modified Wed Mar 6 17:55:38 2002 UTC (7 years, 8 months ago) by ianh
File length: 7996 byte(s)
Diff to previous 91398 (colored)
apr-utils rename apr_ansi_time_to_apr_time and
apr_exploded_time_t.

PR:
Obtained from:
Submitted by:	Thom May <thom@planetarytramp.net>
Reviewed by:	Ian Holsman

Revision 91398 - (view) (annotate) - [select for diffs]
Modified Wed Oct 10 13:02:22 2001 UTC (8 years, 1 month ago) by wrowe
File length: 8001 byte(s)
Diff to previous 91397 (colored)
  Too many args is a bad thing too, some days

Revision 91397 - (view) (annotate) - [select for diffs]
Modified Wed Oct 10 12:48:09 2001 UTC (8 years, 1 month ago) by wrowe
File length: 7989 byte(s)
Diff to previous 88514 (colored)
  Rewrite of rotatelogs as an apr-ized app.

  Mladen Turk <mturk@mappingsoft.com>, William Rowe

Revision 88514 - (view) (annotate) - [select for diffs]
Modified Wed Mar 14 02:28:23 2001 UTC (8 years, 8 months ago) by trawick
File length: 7090 byte(s)
Diff to previous 88511 (colored)
include string.h for the strstr() prototype

Revision 88511 - (view) (annotate) - [select for diffs]
Modified Tue Mar 13 21:25:28 2001 UTC (8 years, 8 months ago) by coar
File length: 7070 byte(s)
Diff to previous 88184 (colored)
	Enhance customisability of rotatelogs: strftime(3)
	formatting of filename and offset from UTC.

Reviewed by:	Greg Stein, David Reid, OtherBill

Revision 88184 - (view) (annotate) - [select for diffs]
Modified Fri Feb 16 04:26:53 2001 UTC (8 years, 9 months ago) by fielding
File length: 6579 byte(s)
Diff to previous 87501 (colored)
Update copyright to 2001

Revision 87501 - (view) (annotate) - [select for diffs]
Modified Thu Dec 21 21:00:45 2000 UTC (8 years, 11 months ago) by wrowe
File length: 6574 byte(s)
Diff to previous 87049 (colored)
  All the supports now build on APR (+APRUTIL), no reliance on httpd.

Revision 87049 - (view) (annotate) - [select for diffs]
Modified Tue Nov 21 18:40:38 2000 UTC (9 years ago) by wrowe
File length: 6482 byte(s)
Diff to previous 86996 (colored)
  *) Accomodate an out-of-space condition in the piped logs and the
     rotatelogs.c code, and no longer churn log processes for this
     condition.  [Victor J. Orlikowski]

Revision 86996 - (view) (annotate) - [select for diffs]
Modified Fri Nov 17 19:26:15 2000 UTC (9 years ago) by wrowe
File length: 5114 byte(s)
Diff to previous 85558 (colored)
  Just style nits before someone goes and does something significant.

Submitted by:	Victor J. Orlikowski [v.j.orlikowski@gte.net]
Reviewed by:	William Rowe

Revision 85558 - (view) (annotate) - [select for diffs]
Modified Mon Jun 12 23:03:05 2000 UTC (9 years, 5 months ago) by rbb
File length: 4708 byte(s)
Diff to previous 85553 (colored)
Protect system header files with the appropriate macros.

Revision 85553 - (view) (annotate) - [select for diffs]
Modified Mon Jun 12 21:47:17 2000 UTC (9 years, 5 months ago) by rbb
File length: 4680 byte(s)
Diff to previous 85263 (colored)
Clean up a big chunk of ap_config.h.  This basically stops ap_config.h from
including any files.  Because of this change, other files must include
their own headers.  I also cleaned up a couple of other bugs in some
modules because I had to compile them all.

I expect this to break multiple platforms, but this will be fixed over time.
The massive configure cleanup is almost done.  I will go through the files
one more time after this commit.

Revision 85263 - (view) (annotate) - [select for diffs]
Modified Fri May 19 23:24:19 2000 UTC (9 years, 6 months ago) by wrowe
File length: 4660 byte(s)
Diff to previous 85136 (colored)
  Why should Ryan have all the fun?
  Cleans up compiler warning emits.

Revision 85136 - (view) (annotate) - [select for diffs]
Modified Thu May 4 04:02:37 2000 UTC (9 years, 6 months ago) by rbb
File length: 4600 byte(s)
Diff to previous 85054 (colored)
Make reliable piped logs work on 2.0.

Revision 85054 - (view) (annotate) - [select for diffs]
Modified Thu Apr 27 04:22:57 2000 UTC (9 years, 7 months ago) by rbb
File length: 4579 byte(s)
Diff to previous 84881 (colored)
Fix some compile breaks in the support directory.  These have not been
tested, but they do compile at least.

Revision 84881 - (view) (annotate) - [select for diffs]
Modified Fri Mar 31 09:42:55 2000 UTC (9 years, 7 months ago) by fielding
File length: 4561 byte(s)
Diff to previous 84636 (colored)
Update to Apache Software License version 1.1

Revision 84636 - (view) (annotate) - [select for diffs]
Modified Thu Feb 17 13:39:15 2000 UTC (9 years, 9 months ago) by stoddard
File length: 1927 byte(s)
Diff to previous 84632 (colored)
Fix FreeBSD build break caused by my last commit to the file. Doh!

Revision 84632 - (view) (annotate) - [select for diffs]
Modified Wed Feb 16 18:00:22 2000 UTC (9 years, 9 months ago) by stoddard
File length: 1927 byte(s)
Diff to previous 83750 (colored)
Add rotatelogs to the Windows port

Revision 83750 - (view) (annotate) - [select for diffs]
Added Tue Aug 24 06:46:03 1999 UTC (10 years, 3 months ago) by fielding
File length: 1887 byte(s)
Apache 1.3.9 baseline for the Apache 2.0 repository.

Obtained from: Apache 1.3.9 (minus unused files), tag APACHE_1_3_9
Submitted by: Apache Group

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2