httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1005208 - in /httpd/httpd/trunk: docs/manual/mod/core.xml server/log.c
Date Wed, 06 Oct 2010 19:14:45 GMT
Author: sf
Date: Wed Oct  6 19:14:44 2010
New Revision: 1005208

URL: http://svn.apache.org/viewvc?rev=1005208&view=rev
Log:
add %v and %V to ErrorLogFormat

Modified:
    httpd/httpd/trunk/docs/manual/mod/core.xml
    httpd/httpd/trunk/server/log.c

Modified: httpd/httpd/trunk/docs/manual/mod/core.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.xml?rev=1005208&r1=1005207&r2=1005208&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.xml Wed Oct  6 19:14:44 2010
@@ -1163,6 +1163,15 @@ in case of an error</description>
         <td>The current time in compact ISO 8601 format, including
             micro-seconds</td></tr>
 
+    <tr><td><code>%...v</code></td>
+        <td>The canonical <directive module="core">ServerName</directive>
+            of the current server.</td></tr>
+
+    <tr><td><code>%...V</code></td>
+        <td>The server name of the server serving the request according to the
+            <directive module="core" >UseCanonicalName</directive>
+            setting.</td></tr>
+
     <tr><td><code>\&nbsp;</code> (backslash space)</td>
         <td>Non-field delimiting space</td></tr>
 

Modified: httpd/httpd/trunk/server/log.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/log.c?rev=1005208&r1=1005207&r2=1005208&view=diff
==============================================================================
--- httpd/httpd/trunk/server/log.c (original)
+++ httpd/httpd/trunk/server/log.c Wed Oct  6 19:14:44 2010
@@ -737,6 +737,25 @@ static int log_apr_status(const ap_error
     return len;
 }
 
+static int log_server_name(const ap_errorlog_info *info, const char *arg,
+                           char *buf, int buflen)
+{
+    if (info->r)
+        return cpystrn(buf, ap_get_server_name((request_rec *)info->r), buflen);
+
+    return 0;
+}
+
+static int log_virtual_host(const ap_errorlog_info *info, const char *arg,
+                            char *buf, int buflen)
+{
+    if (info->s)
+        return cpystrn(buf, info->s->server_hostname, buflen);
+
+    return 0;
+}
+
+
 static int log_table_entry(const apr_table_t *table, const char *name,
                            char *buf, int buflen)
 {
@@ -867,6 +886,8 @@ AP_DECLARE(void) ap_register_log_hooks(a
     ap_register_errorlog_handler(p, "P", log_pid, 0);
     ap_register_errorlog_handler(p, "t", log_ctime, 0);
     ap_register_errorlog_handler(p, "T", log_tid, 0);
+    ap_register_errorlog_handler(p, "v", log_virtual_host, 0);
+    ap_register_errorlog_handler(p, "V", log_server_name, 0);
 }
 
 /*



Mime
View raw message