mod_log_config.c revision 8abb19ac6c29f60bb7df36f4303ce66a4ed6d783
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse/* Licensed to the Apache Software Foundation (ASF) under one or more
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * contributor license agreements. See the NOTICE file distributed with
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * this work for additional information regarding copyright ownership.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * The ASF licenses this file to You under the Apache License, Version 2.0
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * (the "License"); you may not use this file except in compliance with
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * the License. You may obtain a copy of the License at
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * Unless required by applicable law or agreed to in writing, software
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * distributed under the License is distributed on an "AS IS" BASIS,
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * See the License for the specific language governing permissions and
33bdcae1f7a1a65e351dda2a766a0cf28b1e695dnd * limitations under the License.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * Modified by djm@va.pubnix.com:
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * If no TransferLog is given explicitly, decline to log.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * This is module implements the TransferLog directive (same as the
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * common log module), and additional directives, LogFormat and CustomLog.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * TransferLog fn Logs transfers to fn in standard log format, unless
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * a custom format is set with LogFormat
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * LogFormat format Set a log format from TransferLog files
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * CustomLog fn format
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * Log to file fn with format given by the format
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * argument
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * There can be any number of TransferLog and CustomLog
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * commands. Each request will be logged to _ALL_ the
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * named files, in the appropriate format.
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * If no TransferLog or CustomLog directive appears in a VirtualHost,
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * the request will be logged to the log file(s) defined outside
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * the virtual host section. If a TransferLog or CustomLog directive
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * appears in the VirtualHost section, the log files defined outside
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * the VirtualHost will _not_ be used. This makes this module compatable
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * with the CLF and config log modules, where the use of TransferLog
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * inside the VirtualHost section overrides its use outside.
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * Examples:
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * TransferLog logs/access_log
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * <VirtualHost>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * LogFormat "... custom format ..."
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * TransferLog log/virtual_only
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * CustomLog log/virtual_useragents "%t %{user-agent}i"
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * </VirtualHost>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * This will log using CLF to access_log any requests handled by the
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse * main server, while any requests to the virtual host will be logged
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * with the "... custom format..." to virtual_only _AND_ using
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * the custom user-agent log to virtual_useragents.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * Note that the NCSA referer and user-agent logs are easily added with
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * CustomLog:
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * CustomLog logs/referer "%{referer}i -> %U"
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * CustomLog logs/agent "%{user-agent}i"
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * RefererIgnore functionality can be obtained with conditional
8464a9c46b967001e38fe3c8afff51a649e9de51dougm * logging (SetEnvIf and CustomLog ... env=!VAR).
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * But using this method allows much easier modification of the
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * log format, e.g. to log hosts along with UA:
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * CustomLog logs/referer "%{referer}i %U %h"
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * The argument to LogFormat and CustomLog is a string, which can include
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * literal characters copied into the log files, and '%' directives as
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * follows:
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...B: bytes sent, excluding HTTP headers.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...b: bytes sent, excluding HTTP headers in CLF format, i.e. a '-'
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * when no bytes where sent (rather than a '0'.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...{FOOBAR}C: The contents of the HTTP cookie FOOBAR
05413593151a238718198cc04ca849b2426be106rse * %...{FOOBAR}e: The contents of the environment variable FOOBAR
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...f: filename
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...h: remote host
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...a: remote IP-address
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...A: local IP-address
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...{Foobar}i: The contents of Foobar: header line(s) in the request
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * sent to the client.
434ad3e8e769a6a7a78c15f3ae2f7ae3adbfbb49wrowe * %...k: number of keepalive requests served over this connection
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...l: remote logname (from identd, if supplied)
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...{Foobar}n: The contents of note "Foobar" from another module.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...{Foobar}o: The contents of Foobar: header line(s) in the reply.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...p: the canonical port for the server
05413593151a238718198cc04ca849b2426be106rse * %...{format}p: the canonical port for the server, or the actual local
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * or remote port
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...P: the process ID of the child that serviced the request.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...{format}P: the process ID or thread ID of the child/thread that
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * serviced the request
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...r: first line of request
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...s: status. For requests that got internally redirected, this
bb0b94431dc9a1591a0a38a6c48925c6d9213c83rse * is status of the *original* request --- %...>s for the last.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...t: time, in common log format time format
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...{format}t: The time, in the form given by format, which should
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * be in strftime(3) format.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...T: the time taken to serve the request, in seconds.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...D: the time taken to serve the request, in micro seconds.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...u: remote user (from auth; may be bogus if return status (%s) is 401)
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...U: the URL path requested.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...v: the configured name of the server (i.e. which virtual host?)
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...V: the server name according to the UseCanonicalName setting
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...m: the request method
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...H: the request protocol
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...q: the query string prepended by "?", or empty if no query string
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...X: Status of the connection.
421d9002d73db52972bcca8f4497fe5d603b6b8eaaron * 'X' = connection aborted before the response completed.
421d9002d73db52972bcca8f4497fe5d603b6b8eaaron * '+' = connection may be kept alive after the response is sent.
421d9002d73db52972bcca8f4497fe5d603b6b8eaaron * '-' = connection will be closed after the response is sent.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * (This directive was %...c in late versions of Apache 1.3, but
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * this conflicted with the historical ssl %...{var}c syntax.)
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...L: Log-Id of the Request (or '-' if none)
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...{c}L: Log-Id of the Connection (or '-' if none)
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * The '...' can be nothing at all (e.g. "%h %u %r %s %b"), or it can
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * indicate conditions for inclusion of the item (which will cause it
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * to be replaced with '-' if the condition is not met). Note that
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * there is no escaping performed on the strings from %r, %...i and
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * %...o; some with long memories may remember that I thought this was
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * a bad idea, once upon a time, and I'm still not comfortable with
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * it, but it is difficult to see how to "do the right thing" with all
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * of '%..i', unless we URL-escape everything and break with CLF.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * The forms of condition are a list of HTTP status codes, which may
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * or may not be preceded by '!'. Thus, '%400,501{User-agent}i' logs
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * User-agent: on 400 errors and 501 errors (Bad Request, Not
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * Implemented) only; '%!200,304,302{Referer}i' logs Referer: on all
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * requests which did *not* return some sort of normal status.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * The default LogFormat reproduces CLF; see below.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * The way this is supposed to work with virtual hosts is as follows:
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * a virtual host can have its own LogFormat, or its own TransferLog.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * If it doesn't have its own LogFormat, it inherits from the main
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * server. If it doesn't have its own TransferLog, it writes to the
87a1c79b7b37702a254920ca5214fb282a4fb085dougm * same descriptor (meaning the same process for "| ...").
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * --- rst */
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsestatic int xfer_flags = (APR_WRITE | APR_APPEND | APR_CREATE | APR_LARGEFILE);
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsestatic apr_status_t ap_default_log_writer(request_rec *r,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse const char **strs,
bb0b94431dc9a1591a0a38a6c48925c6d9213c83rsestatic apr_status_t ap_buffered_log_writer(request_rec *r,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse const char **strs,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsestatic void *ap_default_log_writer_init(apr_pool_t *p, server_rec *s,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse const char* name);
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsestatic void *ap_buffered_log_writer_init(apr_pool_t *p, server_rec *s,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse const char* name);
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsestatic ap_log_writer_init* ap_log_set_writer_init(ap_log_writer_init *handle);
03181bdde77be8e10ed297a02db5d8f98ecb703ewrowestatic ap_log_writer* ap_log_set_writer(ap_log_writer *handle);
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsestatic ap_log_writer *log_writer = ap_default_log_writer;
bb0b94431dc9a1591a0a38a6c48925c6d9213c83rsestatic ap_log_writer_init *log_writer_init = ap_default_log_writer_init;
bb0b94431dc9a1591a0a38a6c48925c6d9213c83rse/* POSIX.1 defines PIPE_BUF as the maximum number of bytes that is
bb0b94431dc9a1591a0a38a6c48925c6d9213c83rse * guaranteed to be atomic when writing a pipe. And PIPE_BUF >= 512
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * is guaranteed. So we'll just guess 512 in the event the system
bb0b94431dc9a1591a0a38a6c48925c6d9213c83rse * doesn't have this. Now, for file writes there is actually no limit,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * the entire write is atomic. Whether all systems implement this
bb0b94431dc9a1591a0a38a6c48925c6d9213c83rse * correctly is another question entirely ... so we'll just use PIPE_BUF
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * because it's probably a good guess as to what is implemented correctly
bb0b94431dc9a1591a0a38a6c48925c6d9213c83rse * everywhere.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * multi_log_state is our per-(virtual)-server configuration. We store
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * an array of the logs we are going to use, each of type config_log_state.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * If a default log format is given by LogFormat, store in default_format
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * (backward compat. with mod_log_config). We also store for each virtual
7f683bb300df767164724ebc664f339ac396b434dougm * server a pointer to the logs specified for the main server, so that if this
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * vhost has no logs defined, we can use the main server's logs instead.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * So, for the main server, config_logs contains a list of the log files
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * and server_config_logs is empty. For a vhost, server_config_logs
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * points to the same array as config_logs in the main server, and
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * config_logs points to the array of logs defined inside this vhost,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * which might be empty.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsetypedef struct {
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * config_log_state holds the status of a single log file. fname might
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * be NULL, which means this module does no logging for this
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * request. format might be NULL, in which case the default_format
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * from the multi_log_state should be used, or if that is NULL as
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * well, use the CLF.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * log_writer is NULL before the log file is opened and is
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * set to a opaque structure (usually a fd) after it is opened.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsetypedef struct {
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsetypedef struct {
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse const char *fname;
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse const char *format_string;
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse /** place of definition or NULL if already checked */
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * log_request_state holds request specific log data that is not
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * part of the request_rec.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsetypedef struct {
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * Format items...
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse * Note that many of these could have ap_sprintfs replaced with static buffers.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsetypedef struct {
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse if (i <= 0) {
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse return "-";
421d9002d73db52972bcca8f4497fe5d603b6b8eaaron return apr_itoa(p, i);
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsestatic const char *constant_item(request_rec *dummy, char *stuff)
bb0b94431dc9a1591a0a38a6c48925c6d9213c83rsestatic const char *log_remote_host(request_rec *r, char *a)
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse return ap_escape_logitem(r->pool, ap_get_remote_host(r->connection,
a0e0d20b666cfc453ac76506079eb50e03997eefdougmstatic const char *log_remote_address(request_rec *r, char *a)
a0e0d20b666cfc453ac76506079eb50e03997eefdougmstatic const char *log_local_address(request_rec *r, char *a)
a0e0d20b666cfc453ac76506079eb50e03997eefdougmstatic const char *log_remote_logname(request_rec *r, char *a)
a0e0d20b666cfc453ac76506079eb50e03997eefdougm return ap_escape_logitem(r->pool, ap_get_remote_logname(r));
a0e0d20b666cfc453ac76506079eb50e03997eefdougmstatic const char *log_remote_user(request_rec *r, char *a)
a0e0d20b666cfc453ac76506079eb50e03997eefdougmstatic const char *log_request_line(request_rec *r, char *a)
a0e0d20b666cfc453ac76506079eb50e03997eefdougm /* NOTE: If the original request contained a password, we
a0e0d20b666cfc453ac76506079eb50e03997eefdougm * re-write the request line here to contain XXXXXX instead:
a0e0d20b666cfc453ac76506079eb50e03997eefdougm * (note the truncation before the protocol string for HTTP/0.9 requests)
a0e0d20b666cfc453ac76506079eb50e03997eefdougm * (note also that r->the_request contains the unmodified request)
a0e0d20b666cfc453ac76506079eb50e03997eefdougmstatic const char *log_request_file(request_rec *r, char *a)
a0e0d20b666cfc453ac76506079eb50e03997eefdougmstatic const char *log_request_uri(request_rec *r, char *a)
a0e0d20b666cfc453ac76506079eb50e03997eefdougmstatic const char *log_request_method(request_rec *r, char *a)
22357f10585a847ebf7b084cbe1db07ba071aeb6dougm return r->connection->log_id ? r->connection->log_id : "-";
dd7c683f683624b082d430935b594df7406782c2dougmstatic const char *log_request_protocol(request_rec *r, char *a)
dd7c683f683624b082d430935b594df7406782c2dougmstatic const char *log_request_query(request_rec *r, char *a)
3c65aa88903de7330a07e133dfda779842fadad4wrowestatic const char *log_handler(request_rec *r, char *a)
b40799adcfd0f0a2a465c2934585986f7bbc9bbcwrowestatic const char *clf_log_bytes_sent(request_rec *r, char *a)
b40799adcfd0f0a2a465c2934585986f7bbc9bbcwrowe return "-";
3c65aa88903de7330a07e133dfda779842fadad4wrowestatic const char *log_bytes_sent(request_rec *r, char *a)
3c65aa88903de7330a07e133dfda779842fadad4wrowe return "0";
b40799adcfd0f0a2a465c2934585986f7bbc9bbcwrowestatic const char *log_header_in(request_rec *r, char *a)
b40799adcfd0f0a2a465c2934585986f7bbc9bbcwrowe return ap_escape_logitem(r->pool, apr_table_get(r->headers_in, a));
d94fd18ee21dc9b8c1f422144a881e941687d41fdougmstatic APR_INLINE char *find_multiple_headers(apr_pool_t *pool,
dd9940ba9b4d9c09f034b910d1569db4a5111c75dougm const char *key)
98f81eac9530d487f05013cda9df99755bb59689trawick const char *value;
while (rp) {
return result;
return NULL;
const char *cookies_entry;
if (name) {
char *last;
--last;
return NULL;
unsigned t_validate;
#define TIME_FMT_CUSTOM 0
char *fmt = a;
if (!*fmt) {
fmt++;
a = fmt;
if (!*fmt) {
fmt++;
a = fmt;
if (!*fmt) {
if (!*fmt) {
else if (!*fmt) {
switch (fmt_type) {
case TIME_FMT_ABS_SEC:
case TIME_FMT_ABS_MSEC:
case TIME_FMT_ABS_USEC:
case TIME_FMT_ABS_MSEC_FRAC:
case TIME_FMT_ABS_USEC_FRAC:
return buf;
* See the comments in server/util_time.c for more information.
sizeof(*cached_time));
char sign;
int timz;
if (timz < 0) {
#if APR_HAS_THREADS
&tid);
const char **sa)
s = *sa;
s = *sa;
*sa = s;
return NULL;
const char *s = *sa;
*sa = ++s;
return NULL;
while (apr_isdigit(*++s)) {
if (!handler) {
*sa = s;
return NULL;
char *res;
return NULL;
s = APR_EOL_STR;
const char *cp;
int in_list = 0;
const char **strs;
int *strl;
char *envar;
return DECLINED;
return DECLINED;
return DECLINED;
const char *err;
if (rc < 0)
if (rc <= 0)
return DECLINED;
orig = r;
while (r->next) {
r = r->next;
if (!log_writer) {
return HTTP_INTERNAL_SERVER_ERROR;
return OK;
return OK;
return mls;
return add;
const char *name)
return err_string;
const char *err;
if (err)
return err;
return err_string;
const char *fn)
if (buffered_logs) {
return NULL;
{NULL}
return NULL;
return cls;
const char *dummy;
const char *format;
if (format) {
if (format) {
return DONE;
if (format) {
return DONE;
return OK;
if (!buffered_logs)
return APR_SUCCESS;
for (; s; s = s->next) {
if (log_list) {
return APR_SUCCESS;
int res;
if (buffered_logs) {
return res;
int mpm_threads;
if (buffered_logs) {
#if APR_HAS_THREADS
return old;
return old;
void *handle,
const char **strs,
int *strl,
int nelts,
char *str;
s += strl[i];
return rv;
const char* name)
return NULL;
if (!fname) {
return NULL;
return NULL;
return fd;
const char* name)
buffered_log *b;
if (b->handle) {
return NULL;
void *handle,
const char **strs,
int *strl,
int nelts,
char *str;
return rv;
apr_size_t w;
s += strl[i];
w = len;
s += strl[i];
return rv;
if (log_pfn_register) {
buffered_logs = 0;
return OK;
return OK;
return !OK;
return OK;
s = s->next;
return rv;