90d825842fd7d4d983fb5449d40d6b94c4968d26 1666417 |
|
13-Mar-2015 |
rjung |
Choose "-D" instead of "-d" for the rotatelogs
option that creates the path to the log file.
I want to use "-d" for another directory related
option next where (I think) the "directory" "d"
makes more sense.
"-d" has not yet been backported, so changing
to "-D" is not a real compatibility issue. |
8fa9efb0e9a03ce7b482ac96140a8043f6b0ef67 1666415 |
|
13-Mar-2015 |
rjung |
Small changes to rotatelogs:
- add "-n num" to help text
- clarify in help text, that "program is invoked"
is the "-p" case
- prevent crash with "-v" (verbose) if no
"-p prog" is used
- add one space for formatting |
bd7e87dfb94adceb5742fda92b6412701a9b73d4 1587255 |
|
14-Apr-2014 |
jorton |
* support/rotatelogs.c (main): Prevent creation of zombies from
post-rotate programs. |
7db380203c3cb6915d773e0883010d123643c4dd 1542416 |
|
15-Nov-2013 |
trawick |
more apr_file_write_full() simplification (like r1542413) |
bfbf6ec78fa5e2ee4c9a044b0d275cdd634c6372 1537718 |
|
31-Oct-2013 |
jorton |
* support/rotatelogs.c: Introduce an adjusted_time_t type to store the
weird "adjusted time since epoch" type returned by get_now().
Switch from int to long to fix an unnecessary Y2K38 issue. Adjust
use throughout and clean up other type issues. No functional change
intended apart from fixing Y2K38. |
cd59997b784a79f92997759bb95123f35117cf99 1534914 |
|
23-Oct-2013 |
breser |
rotatelogs: Remove last constant length error buffer.
* support/rotatelogs.c
(ERRMSGSZ): Remove.
(rotate_status): Remove errbuff member.
(truncate_and_write_error): Accept the error message as an argument.
(doRotate): Shift the pool destruction slightly later and use it to generate
the error message to pass truncate_and_write_error().
(main): In case of write errors create a pool to generate the error message,
since the other pools available may never been freed. Adjust to pass
message directly to truncate_and_write_error(). |
a3e561d850fa205eb73a3653e70cef0a92509bcd 1534896 |
|
23-Oct-2013 |
breser |
rotatelogs: Remove another use of a consant length buffer for errors.
* support/rotatelogs.c
(doRotate): Use apr_psprintf() and %pm. Move the destruction of the pool
after we're done with the error message so the error string stays allocated
long enough. |
33ce841bd19de25ff3317e4be422cc5be0781ab8 1534895 |
|
23-Oct-2013 |
breser |
rotatelogs: Use apr_psprintf() with %pm instead of a constant length buffer for
errors.
* support/rotatelogs.c
(post_rotate, doRotate): Switch to using apr_psprintf() with %pm.
Suggested by: rpluem |
d729f64685f2d2056159c34ccdbb0423cd14cb36 1533810 |
|
19-Oct-2013 |
breser |
Add an option to autocreate directories to rotatelogs.
* support/rotatelogs.c
(rotate_config): Remove const from szLogRoot since we'll be passing it to
apr_filepath_merge. Add create_path member.
(usage, dumpConfig): Update to reflect new -d option.
(doRotate): Add code that knows how to create the directories a log file
is going to go into.
(main): Add the -d option and canonicalize the incoming path with
apr_filepath_merge() so that the code in doRotate can work properly.
* docs/man/rotatelogs.8,
docs/manual/programs/rotatelogs.html.en: Update for -d option.
PR: 46669
Submitted by: Philippe Lantin <plantin cobaltgroup.com>
(which was actually a patch written by myself when I worked there)
Tweaked by: breser (ported to trunk and changed option from -p to -d) |
3c4230a9f79156e67483f3184cf237510976a5cb 1532289 |
|
15-Oct-2013 |
jorton |
* support/rotatelogs.c (get_now): Fix the NULL ptr dereferences
added in r1532281. |
a1b32785c6316dcee3ea6afa3c8b3435a64e32da 1532281 |
|
15-Oct-2013 |
jorton |
* support/rotatelogs.c (get_now): Return the offset applied to the
Unix time as a parameter.
(doRotate): When exploding the time for strtfime formatting, iff in
-l mode, subtract the offset and explode the real Unix time as a
local time so %Z etc works correctly. |
5e3d3e90e36e9a285cb903095e20773a7248fc1f 1490761 |
|
07-Jun-2013 |
covener |
don't truncate the very first file opened (unless the truncate flag is there too) |
a77a7d850e4496179e1e0f45d5152865c899d421 1490493 |
|
07-Jun-2013 |
covener |
rotatelogs: add -n number-of-files option to roate through a number
of fixed-name logfiles. |
2ee254731c6fa484f399f6be6b627b21e1a912af 1463736 |
|
02-Apr-2013 |
jailletc36 |
Use apr_snprintf(... "%pm"...) instead of explicit call to apr_strerror |
8de32c55b2bac139eb2cb2bb20d21b0e254c3088 1416121 |
|
02-Dec-2012 |
jailletc36 |
error[120] is already defined in this function. Just use it instead of shadowing. |
da40bd7888196edaed7b4344fe23093d999a5136 1409800 |
|
15-Nov-2012 |
jorton |
* support/rotatelogs.c: Cleanups, no functional change. Drop revision
history, "svn log" works; use APR_PATH_MAX; constify more. |
ed6c0b9df3f71a207e48e5c87e9a767e68b54b1a 1409726 |
|
15-Nov-2012 |
jorton |
* support/rotatelogs.c (post_rotate): Really omit the second arg when
invoking a post-rotate program, rather than passing an empty arg.
(Fixes to code match desired&documented behaviour.) |
306d2e9a37bb1314a777897017954e547c6bd9ff 1374247 |
|
17-Aug-2012 |
jorton |
* support/rotatelogs.c (truncate_and_write_error): Factor out from
doRotate, main; make error handling consistant and print the actual
error to stderr.
(doRotate, main): Use it.
PR: 45084 |
459eaf0826f995b73a0dc066f59ea10d2824e72d 1331110 |
|
26-Apr-2012 |
sf |
Replace use of apr_file_write() with apr_file_write_full() to prevent
incomplete writes.
Add comments in some places where error handling/logging is missing.
PR: 53131.
Submitted by: Nicolas Viennot <apache viennot biz>, Stefan Fritsch |
65dec0561786621bd67f57e8054dcf80923b6cb1 1189220 |
|
26-Oct-2011 |
jorton |
* support/rotatelogs.c (usage, main): Add support for -c option.
Submitted by: Jan Kaluža <jkaluza redhat.com> |
5bfaaf573bacb45c1cf290ce85ecc676587e8a64 1174751 |
|
23-Sep-2011 |
jim |
Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change |
aed868f8dd7fe044d91f26226a8b66af40f26770 1140226 |
|
27-Jun-2011 |
jorton |
* support/rotatelogs.c (main): Exit with success on EOF. |
0a7315a00d1351fac84109fee452143200bdd075 1140138 |
|
27-Jun-2011 |
jorton |
Simplify state handling in rotatelogs, fixing -L support in the case
where open() fails for a new log file.
* support/rotatelogs.c (struct logfile): New structure.
(struct rotate_status): Store only current logfile state here, using
struct logfile.
(close_logfile): Rename from closeFile; assume a valid logfile
structure is passed in; simplify to use stored filename.
(checkRotate, main): Adjust for new structure.
(post_rotate): Adjust, move linkfile handling here.
(doRotate): Simplify. |
ac738faa5ec958960f59f60b0109fb103874b8e3 1140099 |
|
27-Jun-2011 |
jorton |
Tweak rotatelogs -p such that the program is invoked the first time a
new log file is opened as well as for rotations:
* support/rotatelogs.c (usage): Update.
(post_rotate): Omit third arg if no prev logfile known.
(doRotate): Invoke even if no previous logfile was open. |
0c2193f47081b894ed16f4fc371f44564d28b334 1137590 |
|
20-Jun-2011 |
jorton |
rotatelogs: Add support for running a custom program after a log
rotation.
* support/rotatelogs.c (post_rotate): New function.
(usage, dumpConfig): Update.
(doRotate): Save old filename before rotate; call post_rotate after
successful rotation.
(main): Add -p argument.
* docs/manual/programs/rotatelogs.xml: Document -p.
PR: 51285
Submitted by: <sveniu ifi.uio.no>, jorton |
862bbb262644e8aefae1bf352552b01908ecae0e 1051582 |
|
21-Dec-2010 |
minfrin |
rotatelogs: Add -e option to write logs through to stdout for optional
further processing. |
aece519b0090449ec263bcf6a28bac3a57b88b20 1024359 |
|
19-Oct-2010 |
poirier |
With rotatelogs -v, on platforms where APR_FINFO_NAME is not implemented,
the verbose printf for closing the file never occurred because apr_file_info_get()
always returned APR_INCOMPLETE. Fix that so we still get a printf with the
information we get back. |
4a5329dc80d2da163d3eb2f3ab26234b5c271c7a 1004962 |
|
06-Oct-2010 |
fuankg |
Renamed optarg -> opt_arg to avoid name clashes with system-own optarg;
removed leftover from IDE build times. |
eb38f34ee0488871b2c68da89bc654390126b81a 917029 |
|
27-Feb-2010 |
minfrin |
Use portable apr_snprintf in rotatelogs. |
c44902d07eab7deb803a59e959f57cf3b7d56655 916377 |
|
25-Feb-2010 |
poirier |
Add -L option to create a hard link to the current log file.
PR: 48761
Submitted by: <lindon orthanc.ca>
With additional changes by: poirier |
9f35dd32eedd781d218a85f0315ea5526a8adc84 910719 |
|
16-Feb-2010 |
minfrin |
support/rotatelogs: Support the simplest log rotation case, log
truncation. Useful when the log is being processed in real time
using a command like tail. |
4a13940dc2990df0a798718d3a3f9cf1566c2217 807930 |
|
26-Aug-2009 |
bjh |
Bring back OS/2 support.
Reverses r758929 with a little bit of conflict resolution. |
1ca054782cb35b5f67686a41b1df75c269fa617b 758929 |
|
27-Mar-2009 |
trawick |
remove OS/2 platform support |
c260519ffae0145566701d85707cba92e7073b4b 734973 |
|
16-Jan-2009 |
rjung |
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. |
15523e69b2c3a6d65f686c591a296b103a1d2112 733532 |
|
11-Jan-2009 |
rjung |
Adopt latest changes in usage message. |
d4ee4552489641d35d1195bbbd6021351c4b79aa 733531 |
|
11-Jan-2009 |
rjung |
Allow size units B, K, M, G and combination of
time and size based rotation for rotatelogs. |
9e152751ed380f87c5ecae4fb0221c956e5fbd24 733520 |
|
11-Jan-2009 |
rjung |
rotatelogs: Add flag for verbose (debug) output. |
9507616ead18df89b66637893dff362dcfa2602a 733517 |
|
11-Jan-2009 |
rjung |
More rotatelogs changes:
- checkRotate() notes the reason for rotation
- rename a few variables
- rename some macros and introduce a few more |
d75dcf983abeb4ed95203da82bccb5d2a8b5d28b 733513 |
|
11-Jan-2009 |
rjung |
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 |
d42659c16697db799f1a1f6e24b0e9b18494fd2b 733495 |
|
11-Jan-2009 |
rjung |
Use APR_WANT_STRFUNC and apr_want.h instead
of APR_HAVE_* and system header inclusion. |
b59cb5b48320654d41cd63ebcd3e8ae6576b637a 733493 |
|
11-Jan-2009 |
rjung |
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? |
174b22740afe573380892fc772510a87c1a578e5 733484 |
|
11-Jan-2009 |
rjung |
Addition to r733479 and r733479:
Mainly cleanup plus correct decision in checkRotate()
if status->nLogFD is NULL. |
02a76e768896844776998f50942a6b786da28acb 733479 |
|
11-Jan-2009 |
rjung |
Addition to r744476:
- Fix compilation error
- set correct time when forcing log file open
on startup |
90d1a73c77413217a855cd8e9bb8497abbdfb18b 733476 |
|
11-Jan-2009 |
rjung |
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 |
3c488b294fcae4f0c24e4a5ccfc4dc8eb41bb192 646845 |
|
10-Apr-2008 |
trawick |
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. |
a55905a382027bdcc3a29248db4176527d36aa9a 632355 |
|
29-Feb-2008 |
jim |
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. |
64bf71725ee015894b1724bc0dd198e5e24424ec 615901 |
|
28-Jan-2008 |
rpluem |
* Don't leak memory when reopening the logfile.
PR: 40183
Submitted by: rpluem, Takashi Sato <serai lans-tv.com>
Reviewed by: rpluem |
0d529159d06aec095a1e0612e2d629c98dc75512 600154 |
|
01-Dec-2007 |
rpluem |
- 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 |
69ea227d92eb79b0828350e75e99f37a6045e371 596796 |
|
20-Nov-2007 |
trawick |
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. |
39de6f4e19f399e14fa61d9f73b83d2c16638326 596698 |
|
20-Nov-2007 |
trawick |
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 |
15b13422ccc4ae4b4c34dcb7bd5e689aa4f2f422 485828 |
|
11-Dec-2006 |
trawick |
increase size of error string buffer passed to apr_strerror();
120 is the size most frequently used in Apache; APR provides no
hints |
62cd2833e1fc0f71de15c9f493a2025dad81dc72 478135 |
|
22-Nov-2006 |
jorton |
* support/rotatelogs.c (main): Produce useful error message for open()
failures.
PR: 39487 |
842ae4bd224140319ae7feec1872b93dfd491143 420983 |
|
11-Jul-2006 |
fielding |
update license header text |
3d81f57512275ca06a60a9bcbd23c1f8b429fdf2 395228 |
|
19-Apr-2006 |
colm |
Update the copyright year in all .c, .h and .xml files |
e8f95a682820a599fe41b22977010636be5c2717 332306 |
|
10-Nov-2005 |
jim |
No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines |
08cb74ca432a8c24e39f17dedce527e6a47b8001 151408 |
|
04-Feb-2005 |
jerenkrantz |
Update copyright year to 2005 and standardize on current copyright owner line. |
393d57ecf4027bddb2cc516e46899aa096a467d2 103973 |
|
16-Jun-2004 |
coar |
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> |
f014fb12592fa1d2bb5bc429e966c9a19ced6e7d 103945 |
|
14-Jun-2004 |
coar |
oops; left over from an earlier version |
6031aec01aeaaa5db689b231d8d97883d575b8ef 103921 |
|
11-Jun-2004 |
coar |
add "-l" option to indicate interval is based on localtime not gmt |
6de8046f8f7e07cd83895a528df25d977e502c76 102619 |
|
09-Feb-2004 |
nd |
fix name of The Apache Software Foundation |
365b268c7d5320369bfdfb140a2b0cfa3dd4a5fc 102592 |
|
08-Feb-2004 |
nd |
fix copyright dates according the first cehck in |
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dc 102525 |
|
06-Feb-2004 |
nd |
apply Apache License, Version 2.0 |
26a4456dd6f1a5d7d7fff766551461a578687c4a 102135 |
|
01-Jan-2004 |
nd |
update license to 2004. |
33bdcae1f7a1a65e351dda2a766a0cf28b1e695d 98573 |
|
03-Feb-2003 |
nd |
finished that boring job:
update license to 2003.
Happy New Year! ;-)) |
9f6fb8d218e41694487b4163575c8ba75bf3eef3 97570 |
|
20-Nov-2002 |
trawick |
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 |
e82d12088d84008384d9537bbc9911181acc80d6 95675 |
|
14-Jun-2002 |
wrowe |
Cleanup some type mismatch emits and consistify to our new apr time helpers |
0118ffe300c1393f285fe2ac31970bba94652e21 95645 |
|
13-Jun-2002 |
rbb |
Just quiet an annoying warning. |
bfa5c37259833629155d486bb1571d39a57de64d 95619 |
|
12-Jun-2002 |
bnicholes |
Added log rotation based on file size to the RotateLog support utility. |
70ba2c1e33a1761ba6d0668156b1be2b2982ecf4 95614 |
|
11-Jun-2002 |
bnicholes |
Oops, found another typo |
cd87e0fb23addb6254637654b80cb013d25a9a13 95613 |
|
11-Jun-2002 |
bnicholes |
Fixing a typo |
563fa6715f6ad5703d30354644d61968a8460804 94633 |
|
13-Apr-2002 |
wrowe |
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?) |
93ef028b3ac7dc86ec72204233b9d99c69587c54 94081 |
|
21-Mar-2002 |
striker |
Update callers of apr_explode_gmt to apr_time_exp_gmt. The
function was renamed in apr.
Submitted by: Thom May <thom@planetarytramp.net> |
bc8fd1b0b1afdf89b8d28eefa8cd74e26ba97986 93918 |
|
13-Mar-2002 |
fielding |
Update our copyright for this year. |
01e8aca9299a0b872414c24c8b7724d6f88ae665 93733 |
|
06-Mar-2002 |
ianh |
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 |
e135eed4d734e0b20b28b0c13aa53842be5f5712 91398 |
|
10-Oct-2001 |
wrowe |
Too many args is a bad thing too, some days |
392c66d02460c84bf69acca30cdfaba34e597ada 91397 |
|
10-Oct-2001 |
wrowe |
Rewrite of rotatelogs as an apr-ized app.
Mladen Turk <mturk@mappingsoft.com>, William Rowe |
f24c898e6b6d6d94527294ab02b53879ad759b0d 88514 |
|
14-Mar-2001 |
trawick |
include string.h for the strstr() prototype |
faa6e5d8b210456ae4dad0398dfa40a19fd89d59 88511 |
|
13-Mar-2001 |
coar |
Enhance customisability of rotatelogs: strftime(3)
formatting of filename and offset from UTC.
Reviewed by: Greg Stein, David Reid, OtherBill |
b99dbaab171d91e1b664397cc40e039d0c087c65 88184 |
|
16-Feb-2001 |
fielding |
Update copyright to 2001 |
bb65aeae7af1d33b64252bbc1b966942d757ac60 87501 |
|
21-Dec-2000 |
wrowe |
All the supports now build on APR (+APRUTIL), no reliance on httpd. |
ffb048955d9939c0ab6ff99c2efc412d8e7a191d 87049 |
|
21-Nov-2000 |
wrowe |
*) 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] |
f2db20a8bbfe21313ced57434fd7816ab2b4c12b 86996 |
|
17-Nov-2000 |
wrowe |
Just style nits before someone goes and does something significant.
Submitted by: Victor J. Orlikowski [v.j.orlikowski@gte.net]
Reviewed by: William Rowe |
48d7c43629323c8d5ee9f7bd0d194de0a376b391 85558 |
|
13-Jun-2000 |
rbb |
Protect system header files with the appropriate macros. |
d4f1d9c1ff112a8ab9bee31f196973761329b236 85553 |
|
12-Jun-2000 |
rbb |
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. |
9212f88d3378865fb9d2d1006d00c4d7722b4f30 85263 |
|
20-May-2000 |
wrowe |
Why should Ryan have all the fun?
Cleans up compiler warning emits. |
7f1290cbf118bf3d34aecc68cff2e5bd0a23e126 85136 |
|
04-May-2000 |
rbb |
Make reliable piped logs work on 2.0. |
f551d6effa8e95b39f31f727c5cc748f349317c4 85054 |
|
27-Apr-2000 |
rbb |
Fix some compile breaks in the support directory. These have not been
tested, but they do compile at least. |
f3091cedd4abeda1026d9117c34e8f625754e8ae 84881 |
|
31-Mar-2000 |
fielding |
Update to Apache Software License version 1.1 |
2e4b64595d221bd83ff057541e970c4cc737412d 84636 |
|
17-Feb-2000 |
stoddard |
Fix FreeBSD build break caused by my last commit to the file. Doh! |
96d86960482354ffa1c192ea3df73a4cd46f0d82 84632 |
|
16-Feb-2000 |
stoddard |
Add rotatelogs to the Windows port |
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1 83750 |
|
24-Aug-1999 |
fielding |
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 |