diff options
author | Bill Stoddard <stoddard@apache.org> | 2001-02-10 04:38:48 +0100 |
---|---|---|
committer | Bill Stoddard <stoddard@apache.org> | 2001-02-10 04:38:48 +0100 |
commit | 12da73c42e5d56214a771998d86db4940caae420 (patch) | |
tree | debbbb93310bf7142293693de07342f4fc1314e0 /modules/loggers | |
parent | *) remove obsolete http_conf_globals.h (diff) | |
download | apache2-12da73c42e5d56214a771998d86db4940caae420.tar.xz apache2-12da73c42e5d56214a771998d86db4940caae420.zip |
Add new LogFormat directive, %D, to log time it takes to serve a request
in microseconds.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88046 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/loggers')
-rw-r--r-- | modules/loggers/mod_log_config.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index 16c9f526cc..6b103aae7a 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -145,6 +145,7 @@ * %...{format}t: The time, in the form given by format, which should * be in strftime(3) format. * %...T: the time taken to serve the request, in seconds. + * %...D: the time taken to serve the request, in micro seconds. * %...u: remote user (from auth; may be bogus if return status (%s) is 401) * %...U: the URL path requested. * %...v: the configured name of the server (i.e. which virtual host?) @@ -490,6 +491,11 @@ static const char *log_request_duration(request_rec *r, char *a) / APR_USEC_PER_SEC); } +static const char *log_request_duration_microseconds(request_rec *r, char *a) +{ + return apr_psprintf(r->pool, "%ld", (apr_time_now() - r->request_time)); +} + /* These next two routines use the canonical name:port so that log * parsers don't need to duplicate all the vhost parsing crud. */ @@ -618,6 +624,9 @@ static struct log_item_list { 'C', log_cookie, 0 }, { + 'D', log_request_duration_microseconds, 1 + }, + { '\0' } }; |