1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

225 Commits

Author SHA1 Message Date
Graham Leggett
394e5594d6 Introduce a per connection "peer_ip" and a per request "client_ip" to
distinguish between the raw IP address of the connection and the effective
IP address of the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206291 13f79535-47bb-0310-9956-ffa450edef68
2011-11-25 19:42:04 +00:00
Graham Leggett
d98a314d98 Align the format variable for the raw IP between the error_log and the
access_log.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1205061 13f79535-47bb-0310-9956-ffa450edef68
2011-11-22 16:16:51 +00:00
Graham Leggett
4ee7eea4cf Introduce a per request version of the remote IP address, which can be
optionally modified by a module when the effective IP of the client
is not the same as the real IP of the client (such as a load balancer).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204968 13f79535-47bb-0310-9956-ffa450edef68
2011-11-22 13:10:39 +00:00
Stefan Fritsch
e0184da329 Pass ap_errorlog_info to error_log hook.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204614 13f79535-47bb-0310-9956-ffa450edef68
2011-11-21 17:36:26 +00:00
Stefan Fritsch
add3418303 Fix logic when to call error_log hook
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204595 13f79535-47bb-0310-9956-ffa450edef68
2011-11-21 17:01:10 +00:00
Jeff Trawick
7cc67a8c39 add conn_rec to error log hook
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1203634 13f79535-47bb-0310-9956-ffa450edef68
2011-11-18 13:10:06 +00:00
Stefan Fritsch
4a69a843de Fix per-request / per-conn logging, probably broken by r1041140
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199591 13f79535-47bb-0310-9956-ffa450edef68
2011-11-09 01:36:19 +00:00
Jim Jagielski
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
Stefan Fritsch
07b7057cb1 Fix logging of the log id of subrequests
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1142160 13f79535-47bb-0310-9956-ffa450edef68
2011-07-02 06:45:54 +00:00
Stefan Fritsch
bde65f90cb Add support to ErrorLogFormat for logging the system unique
thread id under Linux


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1138616 13f79535-47bb-0310-9956-ffa450edef68
2011-06-22 20:22:24 +00:00
Stefan Fritsch
c9fd2623da Introduce ap_(get|set)_core_module_config() functions/macros and use them
everywhere.

We know that the core module has module_index 0. Therefore we can save
some pointer operations in ap_get_module_config(cv, &core_module) and
ap_set_module_config(cv, &core_module, val). As these are called rather often,
this may actually have some (small) measurable effect.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68
2011-06-06 21:26:56 +00:00
Jeff Trawick
86d7dd25c4 allow error log formatters to peek at the message format
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1101143 13f79535-47bb-0310-9956-ffa450edef68
2011-05-09 18:43:50 +00:00
Jeff Trawick
7be2d26631 consolidate logic to remove the pidfile in a new API,
ap_remove_pid(), related to existing ap_log_pid() and
ap_read_pid()

presumably this is useful to third-party MPMs as well


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086224 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28 13:35:08 +00:00
Stefan Fritsch
40f5690256 Check for s->module_config before using it, as the faked server_rec from
mod_cgid does not have it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1060245 13f79535-47bb-0310-9956-ffa450edef68
2011-01-18 09:01:19 +00:00
Stefan Fritsch
efa98ce0f0 Fix warning about comparing signed/unsigned
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1041140 13f79535-47bb-0310-9956-ffa450edef68
2010-12-01 19:25:15 +00:00
Stefan Fritsch
286c8622b6 Add a generic pool cleanup function that sets a pointer to NULL and use
it to replace various pool cleanup functions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032167 13f79535-47bb-0310-9956-ffa450edef68
2010-11-06 22:12:41 +00:00
Guenter Knauf
2768a20d29 Added header include for getpid() prototype on Win32.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1025496 13f79535-47bb-0310-9956-ffa450edef68
2010-10-20 11:03:01 +00:00
Stefan Fritsch
39262df913 info.file, info.line, and info.status should not be defined for per-request or
per-conn info


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1021904 13f79535-47bb-0310-9956-ffa450edef68
2010-10-12 20:01:53 +00:00
Stefan Fritsch
2e4a59c5e1 add %v and %V to ErrorLogFormat
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1005208 13f79535-47bb-0310-9956-ffa450edef68
2010-10-06 19:14:44 +00:00
Stefan Fritsch
b65066c6ac Add generate_log_id hook to allow to use the ID generated by mod_unique_id as
error log ID for requests.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002125 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 11:53:17 +00:00
Stefan Fritsch
107c5573e1 In ErrorLogFormat, make it possible to log an item only if the loglevel
of the message is higher than a specified value. This allows to achive
the old behaviour for the source file name/line number of being only
logged for debug and higher.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1001381 13f79535-47bb-0310-9956-ffa450edef68
2010-09-26 07:40:15 +00:00
Stefan Fritsch
d0bc2d2cfb add errorlog formats for request notes and env vars
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@996307 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 12:59:10 +00:00
Stefan Fritsch
fbeadc3cc4 readability fix, as suggested by Ruediger Pluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@995870 13f79535-47bb-0310-9956-ffa450edef68
2010-09-10 17:00:08 +00:00
Stefan Fritsch
3ad914e110 - Add another check during ErrorLogFormat parsing
- Simplify code (including Ruediger's suggestions)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@993120 13f79535-47bb-0310-9956-ffa450edef68
2010-09-06 18:53:38 +00:00
Stefan Fritsch
70be0f7a07 Add ErrorLogFormat directive for configuring the error log format, including
additional information that is logged once per connection or request.

Add error log IDs for connections and request to allow correlating error log
lines and the corresponding access log entry.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992806 13f79535-47bb-0310-9956-ffa450edef68
2010-09-05 15:44:19 +00:00
Stefan Fritsch
6639073375 Change log_error_core to prefer s over c->base_server for loglevel
configuration.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@954976 13f79535-47bb-0310-9956-ffa450edef68
2010-06-15 17:32:36 +00:00
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