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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1666417 13f79535-47bb-0310-9956-ffa450edef68
- 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
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1666415 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1537718 13f79535-47bb-0310-9956-ffa450edef68
* 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().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1534914 13f79535-47bb-0310-9956-ffa450edef68
* 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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1534896 13f79535-47bb-0310-9956-ffa450edef68
* 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)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1533810 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1532281 13f79535-47bb-0310-9956-ffa450edef68
incomplete writes.
Add comments in some places where error handling/logging is missing.
PR: 53131.
Submitted by: Nicolas Viennot <apache viennot biz>, Stefan Fritsch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1331110 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1140138 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1140099 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024359 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@734973 13f79535-47bb-0310-9956-ffa450edef68
- 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
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733513 13f79535-47bb-0310-9956-ffa450edef68
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?
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733493 13f79535-47bb-0310-9956-ffa450edef68
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
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733476 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@646845 13f79535-47bb-0310-9956-ffa450edef68