1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-08 04:22:21 +03:00
Commit Graph

143 Commits

Author SHA1 Message Date
Stefan Fritsch
60d6e32249 Add support for conditional logging depending on an expression.
The syntax is a bit unwieldy, the quotes have to start before
the 'expr=':

    CustomLog "logs/cond_log" combined "expr=req('User-Agent') == 'x'"


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1033157 13f79535-47bb-0310-9956-ffa450edef68
2010-11-09 18:59:33 +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
Rainer Jung
0fa11f3ff9 Adding sub second timestamps and request end time to mod_log_config.
Add special format tokens to %{...}t. The extended syntax allows the
form: "WHICH:WHAT".

WHICH is either:
- "begin": use the time when the request started
- "end": take "now" as the time
You can omit WHICH, default is "begin".
If you omit WHICH, the separating column is not allowed.

WHAT is either:
- "sec": timestamp in Unix seconds
- "msec": timestamp in Unix milliseconds
- "msec_frac": millisecond fraction of the Unix timestamp,
               3 digits, 0-padded
- "usec": timestamp in Unix microseconds
- "usec_frac": microsecond fraction of the Unix timestamp
               6 digits, 0-padded
- anything different from those tokens: use strftime()
You can omit WHAT, default is the formatted timestamp as
used by the Common Log Format.

The implementation uses a new request_config for mod_log_config
to pass the request end time around between different calls to
log formatters, but the end time is only generated if needed.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@979120 13f79535-47bb-0310-9956-ffa450edef68
2010-07-25 21:08:15 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Graham Leggett
5314f77c08 mod_log_config: Add the R option to log the handler used within the
request.
Submitted by: Christian Folini <christian.folini netnea com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@905420 13f79535-47bb-0310-9956-ffa450edef68
2010-02-01 21:38:15 +00:00
Stefan Fritsch
6af9d4c85f fix off by one error
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@834500 13f79535-47bb-0310-9956-ffa450edef68
2009-11-10 15:29:04 +00:00
Stefan Fritsch
16f79b1337 Also remove trailing whitespace in the value
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@834013 13f79535-47bb-0310-9956-ffa450edef68
2009-11-09 10:43:16 +00:00
Stefan Fritsch
5cd0618812 Simplify code by using apr_strtok
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@834006 13f79535-47bb-0310-9956-ffa450edef68
2009-11-09 09:59:53 +00:00
Stefan Fritsch
12e2a81ffc mod_log_config: Make ${cookie}C correctly match whole cookie names
instead of substrings.

PR: 28037
Submitted by: Dan Franklin <dan dan-franklin.com>, Stefan Fritsch


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@833738 13f79535-47bb-0310-9956-ffa450edef68
2009-11-07 19:19:10 +00:00
Jim Jagielski
3a1bc532d2 Backported
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@721034 13f79535-47bb-0310-9956-ffa450edef68
2008-11-26 23:25:37 +00:00
Jim Jagielski
51df5d37cb Make %k work as it should. No regression noted in perl
test framework.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@720250 13f79535-47bb-0310-9956-ffa450edef68
2008-11-24 18:33:09 +00:00
Jim Jagielski
8adcd5a5ac Add in useful feature. %k which logs the keepalives
value.
PR: 45762
        Dan Poirier <poirier@pobox.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@693120 13f79535-47bb-0310-9956-ffa450edef68
2008-09-08 14:52:21 +00:00
Ruediger Pluem
fc83c6138a * Do case insensitive compares for the type of formats of the pid / tid.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@579517 13f79535-47bb-0310-9956-ffa450edef68
2007-09-26 08:44:37 +00:00
Jeff Trawick
c105e90a86 mod_log_config: Add format options for %p so that the actual local
or remote port can be logged.  

PR:  43415
Submitted by: Adam Hasselbalch Hansen <ahh@one.com>
Extensively commented on and/or modified by Ruediger Pluem and Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@579425 13f79535-47bb-0310-9956-ffa450edef68
2007-09-26 01:45:16 +00:00
Ruediger Pluem
5481e4b70a * Remove function format_integer as it is only used by pfmt and just a needless
wrapper around apr_itoa. Thus replace its call by apr_itoa.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@578927 13f79535-47bb-0310-9956-ffa450edef68
2007-09-24 19:30:59 +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
Jim Jagielski
d81de0d9b3 Add ap_append_pid(); This is performed enough to warrant
a function I think, especially with the fact that
the mapping of getpid() to APR_PID_T_FMT isn't
consistant in some areas. 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@265506 13f79535-47bb-0310-9956-ffa450edef68
2005-08-31 15:22:08 +00:00
Jeff Trawick
5b3a9d83fd mod_log_config: %{hextid}P will log the thread id in hex with APR
versions 1.2.0 or higher.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@265033 13f79535-47bb-0310-9956-ffa450edef68
2005-08-31 12:34:07 +00:00
Brian Pane
34e82d6a25 use struct assignment instead of memcpy so the compiler can decide whether to inline the copy loop or call memcpy
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@208972 13f79535-47bb-0310-9956-ffa450edef68
2005-07-03 21:21:46 +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
Paul Querna
196fce4667 * mod_log_config.c: Revert r109866 which used apr_file_writev instead of an
apr_file_write w/ a memcpy. Roy Fielding provided a -1 veto
                    on the commit, based on concerns that writev is not 
                    guaranteed to be atomic like a write.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@110069 13f79535-47bb-0310-9956-ffa450edef68
2004-12-07 03:41:18 +00:00
Paul Querna
9d58018f5e mod_log_config.c: Use iovecs to write the log line to eliminate a memcpy
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@109866 13f79535-47bb-0310-9956-ffa450edef68
2004-12-05 07:05:23 +00:00
Jeff Trawick
ecab476cae mod_log_config: Fix a bug which prevented request completion time
from being logged for I_INSIST_ON_EXTRA_CYCLES_FOR_CLF_COMPLIANCE
processing.

PR:             29696
Submitted by:   Alois Treindl <alois astro.ch>
Reviewed by:	Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103991 13f79535-47bb-0310-9956-ffa450edef68
2004-06-20 13:08:06 +00:00
André Malo
e47931813e this should save one or two cycles
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103767 13f79535-47bb-0310-9956-ffa450edef68
2004-05-25 19:39:50 +00:00
Joe Orton
96c0ef3f90 * modules/loggers/mod_log_config.c, server/log.c (open_error_log,
ap_replace_stderr_log): Use APR_LARGEFILE when opening log files, to
allow log files to exceed the 2Gb limit if necessary.

PR: 13511


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103627 13f79535-47bb-0310-9956-ffa450edef68
2004-05-06 10:18:07 +00:00
André Malo
c2a3b20bea cleanup log_header_out function:
- no need to ask r->err_headers_out, because it's already merged with
  r->headers_out at this stage
- allow multiple headers like Set-Cookie to be logged properly

PR: 27787


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103331 13f79535-47bb-0310-9956-ffa450edef68
2004-04-10 17:48:52 +00:00
Jeff Trawick
3273ddb6de fix an old misfeature: "BufferedLogs Off" would sort-of turn
buffered logging on as it set the log writer to the buffered log
writer, though it would leave the are-logs-buffered flag off

this misfeature combined with recent mutex logic for buffered logs
led to a segfault with "BufferedLogs Off"


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102783 13f79535-47bb-0310-9956-ffa450edef68
2004-02-26 20:15:26 +00:00
Jeff Trawick
7122d6ea3a a kind fix for a compile error unfortunately broke an order
dependency...  the buffered logs array needs to be initialized
prior to opening the logs


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102781 13f79535-47bb-0310-9956-ffa450edef68
2004-02-26 20:00:55 +00:00
André Malo
a688f06b19 fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102618 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:31:03 +00:00
André Malo
5410a0d131 fix copyright dates according to the first checkin
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102566 13f79535-47bb-0310-9956-ffa450edef68
2004-02-08 12:10:29 +00:00
André Malo
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
André Malo
866b6af8f3 in conservative C declarations still have to be the first in a function.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102361 13f79535-47bb-0310-9956-ffa450edef68
2004-01-18 00:00:18 +00:00
Jeff Trawick
e6834bc9b4 mod_log_config: Fix corruption of buffered logs with threaded
MPMs.

PR:               25520


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102355 13f79535-47bb-0310-9956-ffa450edef68
2004-01-17 00:16:45 +00:00
André Malo
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
Joe Orton
3be85f7869 * modules/loggers/mod_log_config.c (log_request_time): Log
the minutes component of the timezone correctly.

PR: 23642
Submitted by: Hong-Gunn Chew <hgbug@gunnet.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101703 13f79535-47bb-0310-9956-ffa450edef68
2003-11-05 17:16:00 +00:00
André Malo
fa20e7a4a7 fix %b format to write really "-" if bytes_sent == 0.
Submitted by: Kess


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101021 13f79535-47bb-0310-9956-ffa450edef68
2003-08-19 16:03:03 +00:00
Jeff Trawick
4144e68db8 fix a comment to explain how to log the thread id
Submitted by:          nd


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99818 13f79535-47bb-0310-9956-ffa450edef68
2003-05-14 02:32:41 +00:00
Jeff Trawick
ab74e345f0 as Andre' pointed out, we don't need %{pid/tid}P since the user
can do %P/%{tid}P or %{pid}P/%{tid}P


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99449 13f79535-47bb-0310-9956-ffa450edef68
2003-04-19 03:06:30 +00:00
Jeff Trawick
f96aba98f9 change the way that thread id is specified in the log format since
the previous implementation used a format string already taken
by mod_logio

now, an optional %P format is used instead

thanks to Andre' Malo for pointing out that I chose a format string
already used by mod_logio!


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99442 13f79535-47bb-0310-9956-ffa450edef68
2003-04-18 19:40:11 +00:00
Jeff Trawick
5d79cd7197 mod_log_config: Add the ability to log the id of the thread
processing the request (%I).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99439 13f79535-47bb-0310-9956-ffa450edef68
2003-04-18 10:44:11 +00:00
William A. Rowe Jr
1e7b7d79bb SECURITY: Eliminated leaks of several file descriptors to child
processes, such as CGI scripts.

PR: 17206
Submitted by:	Christian Kratzer <ck@cksoft.de>, Bjoern A. Zeeb <bz@zabbadoz.net>
Reviewed by:	Joe Orton, Will Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99032 13f79535-47bb-0310-9956-ffa450edef68
2003-03-20 21:50:40 +00:00
André Malo
c8185c253b Minor MMN bump:
Forward port: Escape special characters (especially control
characters) in mod_log_config to make a clear distinction between
client-supplied strings (with special characters) and server-side
strings. This was already introduced in version 1.3.25.

Obtained from: Patch in 1.3.25-dev by Martin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98912 13f79535-47bb-0310-9956-ffa450edef68
2003-03-06 23:53:52 +00:00
Ian Holsman
7f5768e187 change optional function to return the previous writer, allowing to have mutliple types
of writers in the same server. (previously you could only have one)

it needs a mmn bump.. sorry guys
;(


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98648 13f79535-47bb-0310-9956-ffa450edef68
2003-02-14 04:17:34 +00:00
William A. Rowe Jr
cb16c9fcfd Tabs. Runovers. Style violations ... oh my!
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98638 13f79535-47bb-0310-9956-ffa450edef68
2003-02-13 13:54:04 +00:00
André Malo
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
William A. Rowe Jr
a4b9d1c913 Accept '%%' in CustomLog format strings to produce a literal '%'.
Submitted by: Andr� Malo <nd@perlig.de>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97644 13f79535-47bb-0310-9956-ffa450edef68
2002-11-25 15:39:56 +00:00
Jeff Trawick
6f67265758 static-ize a function which is not supposed to be exported
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96835 13f79535-47bb-0310-9956-ffa450edef68
2002-09-16 12:43:36 +00:00
William A. Rowe Jr
822b5eb746 Revisit the code that Ian and I discussed on list. Actually pre-flight
the access logs so that failure conditions are noted earlier, and return
  out of the code using the != OK convention from ap_hook_open_logs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96828 13f79535-47bb-0310-9956-ffa450edef68
2002-09-15 21:37:32 +00:00