httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@covalent.net>
Subject [PATCH] Another note on logging changes
Date Wed, 19 Nov 1997 20:00:21 GMT

Working to include some changes that allow logging to a central 
database. Seems that logging a '-' for bytes sent when it == 0 is a 
bug since we are trying to copy this data to integer fields in a 
database. My guess is that changing this to log a '0' would cause 
some other people grief. I've made a small change to 
mod_log_config.c which allows you to specify %{int}b to log a '0' 
intstead of '-'. It defaults to '-'.

Index: mod_log_config.c
===================================================================
RCS file: /export/home/cvs/apachen/src/modules/standard/mod_log_config.c,v
retrieving revision 1.41
diff -c -r1.41 mod_log_config.c
*** mod_log_config.c	1997/10/22 20:30:24	1.41
--- mod_log_config.c	1997/11/19 19:48:45
***************
*** 113,119 ****
   * literal characters copied into the log files, and '%' directives as
   * follows:
   *
!  * %...b:  bytes sent, excluding HTTP headers.
   * %...{FOOBAR}e:  The contents of the environment variable FOOBAR
   * %...f:  filename
   * %...h:  remote host
--- 113,120 ----
   * literal characters copied into the log files, and '%' directives as
   * follows:
   *
!  * %...b:  bytes sent, excluding HTTP headers. %{int}b logs zero bytes sent
!  *         as a '0' instead of '-'.
   * %...{FOOBAR}e:  The contents of the environment variable FOOBAR
   * %...f:  filename
   * %...h:  remote host
***************
*** 314,320 ****
  
  static char *log_bytes_sent(request_rec *r, char *a)
  {
!     if (!r->sent_bodyct) {
          return "-";
      }
      else {
--- 315,324 ----
  
  static char *log_bytes_sent(request_rec *r, char *a)
  {
!     if (!r->sent_bodyct && !strcasecmp(a, "int")) {
!         return "0";
!     }
!     else if (!r->sent_bodyct) {
          return "-";
      }
      else {



Mime
View raw message