combined logging patch

Jan Krueger <[email protected]> Fri, 09 Feb 2007 18:14:40 +0100
Newsgroups gmane.comp.web.fnord
Message-ID <[email protected]>
--=-XNn8pp/Dy4oMCuTK1hPh
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

hi,

attached patch against fnord 1.11 provides "standard" NCSA
extended/combined log format logging as described here:
http://httpd.apache.org/docs/2.2/mod/mod_log_config.html

Jan

--=-XNn8pp/Dy4oMCuTK1hPh
Content-Disposition: attachment; filename=fnord-combined-0.2.patch
Content-Type: text/x-patch; name=fnord-combined-0.2.patch; charset=UTF-8
Content-Transfer-Encoding: 7bit

--- /usr/src/source/httpd/httpd.c	2006-03-23 02:35:03.000000000 +0100
+++ httpd.c	2007-02-08 23:10:56.000000000 +0100
@@ -76,6 +76,11 @@
  * log analysis tools. */
 /* #define COLF */
 
+/* uncomment the following in addition to #define COLF to get
+ * the combined logging format. This enables more detail with
+ * Apache log analysis tools. */
+/* #define COMB */
+
 /* uncomment the following line to make fnord tarpit queries from
  * EmailSiphon (an email harvester for spammers) */
 #define TARPIT
@@ -228,7 +233,17 @@
   buffer_putulong(buffer_2,retcode);
   buffer_putspace(buffer_2);
   buffer_putrange(buffer_2,len);
-
+# ifdef COMB
+  buffer_putspace(buffer_2);
+  buffer_puts(buffer_2,"\"");
+  if (!refer) refer="none";
+  buffer_putsescaped(buffer_2,refer,0);
+  buffer_puts(buffer_2,"\"");
+  buffer_putspace(buffer_2);
+  buffer_puts(buffer_2,"\"");
+  buffer_putsescaped(buffer_2,ua,0);
+  buffer_puts(buffer_2,"\"");
+# endif
 #else
   buffer_puts(buffer_2,remote_ip?remote_ip:"0.0.0.0");
   buffer_putspace(buffer_2);

--=-XNn8pp/Dy4oMCuTK1hPh--