1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-14 01:22:37 +03:00
Commit Graph

249 Commits

Author SHA1 Message Date
Stefan Fritsch
0d11ddb595 - Introduce ap_log_cserror to allow mod_ssl to associate log messages to
different servers than c->base_server.
- Adjust the scope of some mod_ssl trace logging from server to conn.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@954611 13f79535-47bb-0310-9956-ffa450edef68
2010-06-14 19:59:05 +00:00
Stefan Fritsch
78af971222 Fix the test of ap_mpm_query's result:
Both AP_MPMQ_STATIC and AP_MPMQ_DYNAMIC mean threaded.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@952789 13f79535-47bb-0310-9956-ffa450edef68
2010-06-08 19:41:01 +00:00
Rainer Jung
7965fcc0d3 Add descriptive prefix to pid and tid in the error log.
Only log the tid, if the MPM is threaded.

Suggested by jorton.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@952724 13f79535-47bb-0310-9956-ffa450edef68
2010-06-08 16:26:39 +00:00
Rainer Jung
3a00cf67f3 Add microsecond timestamps to the error log.
The new function ap_recent_ctime_ex allows for
optional formatting hints. It checks the provided buffer
length and returns the number of consumed bytes. This is necessary,
because when using options, the length of the formatted time string
is no longer constant.

The only option implemented currently is the addition of microsecond
fractions to the timestamp.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@952203 13f79535-47bb-0310-9956-ffa450edef68
2010-06-07 12:30:05 +00:00
Rainer Jung
8909a59a12 Add process id and thread id (if APR has thread support)
to the error log.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@952201 13f79535-47bb-0310-9956-ffa450edef68
2010-06-07 12:23:26 +00:00
Stefan Fritsch
2334a1ea4f - Add loglevels to request_rec and conn_rec
- Introduce per-directory loglevel configuration


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951897 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 17:04:40 +00:00
Stefan Fritsch
98a1e93dca - Introduce log levels trace1/.../trace8
- Add macro wrappers for ap_log_*error. On C99, this will save argument
  preparation and function call overhead when a message is not logged
  because of the configured loglevel.
- Introduce per-module loglevel configuration.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951893 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:54:51 +00:00
Stefan Fritsch
e50806751b Improve ap_log_cerror:
- Log remote port
- If the connection seems to be a back-end connection, log 'remote' instead of
  'client'


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@921346 13f79535-47bb-0310-9956-ffa450edef68
2010-03-10 13:36:10 +00:00
Graham Leggett
69eeef38cd Use APR_PID_T_FMT instead of %ld and a cast.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@910747 13f79535-47bb-0310-9956-ffa450edef68
2010-02-16 22:57:00 +00:00
Daniel Earl Poirier
0c96068dc4 Log command line on startup, so there's a record of command line
arguments like -f.  Suggested by Shaya Potter.  [Dan Poirier]
PR: 48752


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@910684 13f79535-47bb-0310-9956-ffa450edef68
2010-02-16 20:50:10 +00:00
Stefan Fritsch
bb616ddda3 Print directive name in error message.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@907012 13f79535-47bb-0310-9956-ffa450edef68
2010-02-05 17:38:08 +00:00
Stefan Fritsch
60821a3b74 replace duplicate code with new function ap_parse_log_level()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@905454 13f79535-47bb-0310-9956-ffa450edef68
2010-02-01 23:27:32 +00:00
Takashi Sato
0534f5f339 Fix string constness to get rid of gcc compiler warnings by -Wwrite-strings.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@894368 13f79535-47bb-0310-9956-ffa450edef68
2009-12-29 12:34:26 +00:00
Jeff Trawick
d854b9d90c fix or complain about some invalid errno references
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@882269 13f79535-47bb-0310-9956-ffa450edef68
2009-11-19 20:00:12 +00:00
Joe Orton
ed5cf0bd64 * server/log.c: Update comment in piped_log structure, now it is
has been made opaque.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@815811 13f79535-47bb-0310-9956-ffa450edef68
2009-09-16 14:45:39 +00:00
William A. Rowe Jr
9a84fd27d6 Force the current directory to the server root in the invocation of the piped
logger processes.

Looking for confirmation from Rainer that this resolves the ambiguity
he observed in Message-ID: <4A0C9430.2090404@kippdata.de>.

Note that the shell may decide to ignore the chdir, so test with "|$cmd"
syntax to compare to the expected behavior from 5/14 or earlier. 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@775327 13f79535-47bb-0310-9956-ffa450edef68
2009-05-15 20:53:33 +00:00
William A. Rowe Jr
10d6aaf94b Ease migration for the hosts of piped loggers out there, handle the
log process selection (| vs $ vs default) in ap_open_piped_log


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@775320 13f79535-47bb-0310-9956-ffa450edef68
2009-05-15 20:40:24 +00:00
William A. Rowe Jr
3aac4df095 Revert the default resource abuse introduced in r104019, which can mask
child logger process failures, by migrating back to 2.0.49 and prior when
rotated logs were reliable on Solaris, etc.

Provides two new piped syntaxes for ErrorLog; "||program" or "|$shellcmd",
where the existing 2.2 behavior may be preserved or the new 2.4 behavior
explicitly elected.  The default should discourage users from "|$" syntax
except as required, in the future.




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@775300 13f79535-47bb-0310-9956-ffa450edef68
2009-05-15 19:46:45 +00:00
Joe Orton
62d1ca305d Make the piped_log structure opaque:
* include/http_log.h: Remove piped_log structure definition here;
  (ap_piped_log_read_fd, ap_piped_log_write_fd): Turn macros into
  functions.             

* server/log.c: Move piped_log structure definition here; replace
  fds[2] with read_fd, write_fd.
  (ap_piped_log_read_fd, ap_piped_log_write_fd): New functions.
  (throughout...): Replace use of ap_piped_log_write_fd, 
  ap_piped_log_read_fd, with direct reference to structure fields.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@775120 13f79535-47bb-0310-9956-ffa450edef68
2009-05-15 13:05:42 +00:00
Rainer Jung
99b7b9877e Revert r774755: ap_server_root_relative() for
piped loggers is nonsense. It doesn't work when
the logger path contains whitespace.

We already allow relative paths because we open
the log program via the shell.

Code was taken from mod_rewrite and mod_log_forensic,
which need to be still fixed (removing
ap_server_root_relative() should suffice).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@774884 13f79535-47bb-0310-9956-ffa450edef68
2009-05-14 19:13:17 +00:00
Rainer Jung
f7ab3be8b1 Allow relative pathnames for piped loggers in ErrorLog.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@774755 13f79535-47bb-0310-9956-ffa450edef68
2009-05-14 12:59:25 +00:00
Rainer Jung
1b28223f35 Add name of program to spawn to the error
message, when starting piped loggers fails.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@774730 13f79535-47bb-0310-9956-ffa450edef68
2009-05-14 11:18:58 +00:00
Rainer Jung
4172cbf0b3 Whitespace cleanup. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@774728 13f79535-47bb-0310-9956-ffa450edef68
2009-05-14 11:03:04 +00:00
Rainer Jung
1dbef32b45 Revert r735516 as requested by wrowe.
Will commit again as smaller patches,
also merging piped_log_wrapper with
the piped_log structure.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@774725 13f79535-47bb-0310-9956-ffa450edef68
2009-05-14 10:47:31 +00:00
Jeff Trawick
cb8a82faed remove TPF support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758936 13f79535-47bb-0310-9956-ffa450edef68
2009-03-27 00:05:18 +00:00
Ruediger Pluem
ac59ef2068 * We need to return an int not a pointer!
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@736110 13f79535-47bb-0310-9956-ffa450edef68
2009-01-20 21:22:10 +00:00
Rainer Jung
288ac7728a Piped error loggers should use the reliable pipes,
i.e. they should be automatically restarted when they die
similar to what happens for access loggers.

Patch makes error loggers use the same code path as
access loggers.

Side effect: patch adds ap_server_root_relative() to the error
logger path before spawning.

Reviewed by R. Pluem.

Patch needs to be tested on Windows.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@735516 13f79535-47bb-0310-9956-ffa450edef68
2009-01-18 18:19:45 +00:00
Sander Temme
3233157214 The error logging core only logs at very high level if it has no
server_rec from which to read the appropriate LogLevel.  Ensure that 
everything gets logged when -DDEBUG is passed to the compiler. 

This makes the server very verbose, on the command line before stderr is 
redirected and in the error log afterwards.  This is appropriate when 
debugging, but not under normal circumstances. 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@686271 13f79535-47bb-0310-9956-ffa450edef68
2008-08-15 16:11:46 +00:00
Paul Querna
a324a1d72f Remove all references to CORE_PRIVATE.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645455 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 10:45:43 +00:00
William A. Rowe Jr
586be549f9 On win32, we must never, never close the parent's copy of the
child's read end for a reliable piped logger.  The child runs
and manages it's own logs, and even if the parent did instead, 
the mpm would be adjusted to pass down the child write ends 
without read ends to the pipes, so this forever makes no sense.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@607666 13f79535-47bb-0310-9956-ffa450edef68
2007-12-31 05:00:16 +00:00
William A. Rowe Jr
4f72c6c9f8 We now have an API to describe pipe creation timeout states, so use it
to ensure no platform has quirks with their particular default.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@587670 13f79535-47bb-0310-9956-ffa450edef68
2007-10-23 22:01:29 +00:00
William A. Rowe Jr
89c12727e9 Share a single write-pipe handle for piped stderr logging, this
prevents an extra logging process from hanging around after the
initial config-phase.

Reviewed by: rpluem, wrowe

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580437 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 17:43:24 +00:00
William A. Rowe Jr
a4512f7019 redux, use Rudgier's instead, better comments.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580436 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 17:41:56 +00:00
William A. Rowe Jr
1823a1d3f1 Logging fixes, round two. Authored and Reviewed by both rplume and wrowe
within the same 10 minutes, this is the obvious fix to prevent any lingering
write handles from hanging around in unexpected ways.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580431 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 17:24:26 +00:00
William A. Rowe Jr
26c8ae35a1 Introduce a specific pool for stderr logging, so that we have two
simultanious pools until the new stderr pipe logger is completely 
initialized.  This ensures we have a stderr channel from the time 
we clear the plog in a previous generation through the invocation
of the open_logs hook in the next generation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@569535 13f79535-47bb-0310-9956-ffa450edef68
2007-08-24 21:49:02 +00:00
William A. Rowe Jr
c43e6c5a24 Refactor r452431, because this should not be fatal to starting
the server if it's horribly broken.  The alternative of returing
'rc' in this case would be to open /dev/null as the error stream
for this generation of the server; and even more useless result.

Also the parent-file was never necessary; we can pass only the
child handle using apr_procattr_child_err_set() and have no extra
file to clean up afterwards.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@568326 13f79535-47bb-0310-9956-ffa450edef68
2007-08-21 23:28:32 +00:00
William A. Rowe Jr
a8a35fe32e This message was confusing during debugging, make it unique.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@568322 13f79535-47bb-0310-9956-ffa450edef68
2007-08-21 23:21:44 +00:00
Joe Orton
acd492152e * server/log.c (ap_open_logs): When dup2'ing the error log to stderr,
use the already-open stderr file object rather than opening a new one.

Submitted by: Tom Donovan <Tom.Donovan acm.org>
PR: 40476


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@467338 13f79535-47bb-0310-9956-ffa450edef68
2006-10-24 14:16:01 +00:00
Joe Orton
d91484f6fc When starting a new piped error logger for the main server, ensure
that the new child's stderr is not a pipe to an old piped logger:

* server/log.c (log_child): Add "dummy_stderr" parameter; if set,
duplicate stdout as the stderr for the child.
(open_error_log): Add "is_main" parameter; use dummy stderr for logger
for main server only.
(ap_open_logs, ap_open_piped_log): Adjust for new open_error_log()/
log_child() parameters.

PR: 40651
Submitted by: jorton, rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@452431 13f79535-47bb-0310-9956-ffa450edef68
2006-10-03 11:40:30 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Jeff Trawick
76c0a8bdd2 fix minor annoyance on z/OS: __FILE__ is set to
"./foo.c" instead of simply "foo.c", so filter
out all but the basename before logging it with
debug messages


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@178299 13f79535-47bb-0310-9956-ffa450edef68
2005-05-24 22:11:24 +00:00
Joe Orton
4741d91295 * server/log.c (piped_log_spawn): Don't leak an fd for each
invocation.

Reviewed by: Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@170719 13f79535-47bb-0310-9956-ffa450edef68
2005-05-18 08:03:37 +00:00
Joe Orton
5e080e68d7 * server/log.c (ap_open_piped_log): Remove errno handling.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@170537 13f79535-47bb-0310-9956-ffa450edef68
2005-05-17 08:03:03 +00:00
Joe Orton
534ee6332c * server/log.c (piped_log_spawn): Return the APR error code,
as expected by piped_log_maintenance (and fixing "Unknown
error" messages in error path there).
(ap_open_piped_log): Expect an APR error code.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@170441 13f79535-47bb-0310-9956-ffa450edef68
2005-05-16 19:59:05 +00:00
Jeff Trawick
f78a4e4a89 Prevent hangs of child processes when writing to piped loggers at
the time of graceful restart. 

PR:          26467
Reviewed by: Joe Orton



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@170281 13f79535-47bb-0310-9956-ffa450edef68
2005-05-15 23:56:48 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
Jeff Trawick
81e4e36b0e add ap_log_cerror(); use it in a couple of places in core output filter
so that the client IP address is recorded in the log


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105625 13f79535-47bb-0310-9956-ffa450edef68
2004-10-29 14:45:24 +00:00
Joe Orton
df6a1b30c2 * server/log.c (log_error_core): For APLOG_DEBUG on Unix, if __FILE__
is an absolute path (as in a VPATH build), just log the basename.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105258 13f79535-47bb-0310-9956-ffa450edef68
2004-09-22 19:47:51 +00:00