moved superflous session logging from log_session to log_sessiondetails
authorMarc Cromme <marc@indexdata.dk>
Fri, 7 Jul 2006 13:02:21 +0000 (13:02 +0000)
committerMarc Cromme <marc@indexdata.dk>
Fri, 7 Jul 2006 13:02:21 +0000 (13:02 +0000)
src/seshigh.c
src/statserv.c

index f9cc23b..e2b2afa 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
  * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: seshigh.c,v 1.93 2006-07-07 12:40:15 marc Exp $
+ * $Id: seshigh.c,v 1.94 2006-07-07 13:02:21 marc Exp $
  */
 /**
  * \file seshigh.c
  */
 /**
  * \file seshigh.c
@@ -102,7 +102,8 @@ static Z_APDU *process_ESRequest(association *assoc, request *reqb, int *fd);
 
 /* dynamic logging levels */
 static int logbits_set = 0;
 
 /* dynamic logging levels */
 static int logbits_set = 0;
-static int log_session = 0; 
+static int log_session = 0; /* one-line logs for session */
+static int log_sessiondetail = 0; /* more detailed stuff */
 static int log_request = 0; /* one-line logs for requests */
 static int log_requestdetail = 0;  /* more detailed stuff */
 
 static int log_request = 0; /* one-line logs for requests */
 static int log_requestdetail = 0;  /* more detailed stuff */
 
@@ -113,6 +114,7 @@ static void get_logbits()
     {
         logbits_set = 1;
         log_session = yaz_log_module_level("session"); 
     {
         logbits_set = 1;
         log_session = yaz_log_module_level("session"); 
+        log_sessiondetail = yaz_log_module_level("sessiondetail");
         log_request = yaz_log_module_level("request");
         log_requestdetail = yaz_log_module_level("requestdetail"); 
     }
         log_request = yaz_log_module_level("request");
         log_requestdetail = yaz_log_module_level("requestdetail"); 
     }
@@ -291,7 +293,8 @@ void ir_session(IOCHAN h, int event)
         }
         else
         {
         }
         else
         {
-            yaz_log(log_session, "Session idle too long. Sending close.");
+            yaz_log(log_sessiondetail, 
+                    "Session idle too long. Sending close.");
             do_close(assoc, Z_Close_lackOfActivity, 0);
         }
         return;
             do_close(assoc, Z_Close_lackOfActivity, 0);
         }
         return;
@@ -329,7 +332,7 @@ void ir_session(IOCHAN h, int event)
             /* We aren't speaking to this fellow */
             if (assoc->state == ASSOC_DEAD)
             {
             /* We aren't speaking to this fellow */
             if (assoc->state == ASSOC_DEAD)
             {
-                yaz_log(log_session, "Connection closed - end of session");
+                yaz_log(log_sessiondetail, "Connection closed - end of session");
                 cs_close(conn);
                 destroy_association(assoc);
                 iochan_destroy(h);
                 cs_close(conn);
                 destroy_association(assoc);
                 iochan_destroy(h);
@@ -339,7 +342,7 @@ void ir_session(IOCHAN h, int event)
             if ((res = cs_get(conn, &assoc->input_buffer,
                 &assoc->input_buffer_len)) <= 0)
             {
             if ((res = cs_get(conn, &assoc->input_buffer,
                 &assoc->input_buffer_len)) <= 0)
             {
-                yaz_log(log_session, "Connection closed by client");
+                yaz_log(log_sessiondetail, "Connection closed by client");
                 cs_close(conn);
                 destroy_association(assoc);
                 iochan_destroy(h);
                 cs_close(conn);
                 destroy_association(assoc);
                 iochan_destroy(h);
@@ -414,7 +417,7 @@ void ir_session(IOCHAN h, int event)
         switch (res = cs_put(conn, req->response, req->len_response))
         {
         case -1:
         switch (res = cs_put(conn, req->response, req->len_response))
         {
         case -1:
-            yaz_log(log_session, "Connection closed by client");
+            yaz_log(log_sessiondetail, "Connection closed by client");
             cs_close(conn);
             destroy_association(assoc);
             iochan_destroy(h);
             cs_close(conn);
             destroy_association(assoc);
             iochan_destroy(h);
@@ -2306,7 +2309,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
                 assoc->init->implementation_name,
                 odr_prepend(assoc->encode, "GFS", resp->implementationName));
 
                 assoc->init->implementation_name,
                 odr_prepend(assoc->encode, "GFS", resp->implementationName));
 
-    version = odr_strdup(assoc->encode, "$Revision: 1.93 $");
+    version = odr_strdup(assoc->encode, "$Revision: 1.94 $");
     if (strlen(version) > 10)   /* check for unexpanded CVS strings */
         version[strlen(version)-2] = '\0';
     resp->implementationVersion = odr_prepend(assoc->encode,
     if (strlen(version) > 10)   /* check for unexpanded CVS strings */
         version[strlen(version)-2] = '\0';
     resp->implementationVersion = odr_prepend(assoc->encode,
index ccd0007..7d4af0b 100644 (file)
@@ -5,7 +5,7 @@
  * NT threaded server code by
  *   Chas Woodfield, Fretwell Downing Informatics.
  *
  * NT threaded server code by
  *   Chas Woodfield, Fretwell Downing Informatics.
  *
- * $Id: statserv.c,v 1.39 2006-07-06 10:17:54 adam Exp $
+ * $Id: statserv.c,v 1.40 2006-07-07 13:02:21 marc Exp $
  */
 
 /**
  */
 
 /**
@@ -127,7 +127,8 @@ statserv_options_block control_block = {
 static int max_sessions = 0;
 
 static int logbits_set = 0;
 static int max_sessions = 0;
 
 static int logbits_set = 0;
-static int log_session = 0;
+static int log_session = 0; /* one-line logs for session */
+static int log_sessiondetail = 0; /* more detailed stuff */
 static int log_server = 0;
 
 /** get_logbits sets global loglevel bits */
 static int log_server = 0;
 
 /** get_logbits sets global loglevel bits */
@@ -137,6 +138,7 @@ static void get_logbits(int force)
     {
         logbits_set = 1;
         log_session = yaz_log_module_level("session");
     {
         logbits_set = 1;
         log_session = yaz_log_module_level("session");
+        log_sessiondetail = yaz_log_module_level("sessiondetail");
         log_server = yaz_log_module_level("server");
     }
 }
         log_server = yaz_log_module_level("server");
     }
 }
@@ -896,7 +898,7 @@ static void listener(IOCHAN h, int event)
             return;
         }
 
             return;
         }
 
-        yaz_log(log_session, "Connect from %s", cs_addrstr(new_line));
+        yaz_log(log_sessiondetail, "Connect from %s", cs_addrstr(new_line));
 
         no_sessions++;
         if (control_block.dynamic)
 
         no_sessions++;
         if (control_block.dynamic)
@@ -1013,7 +1015,7 @@ static void *new_session (void *vp)
 #else
     a = 0;
 #endif
 #else
     a = 0;
 #endif
-    yaz_log(log_session, "Starting session %d from %s (pid=%ld)",
+    yaz_log(log_session, "Session - OK %d %s %ld",
             no_sessions, a ? a : "[Unknown]", (long) getpid());
     if (max_sessions && no_sessions >= max_sessions)
         control_block.one_shot = 1;
             no_sessions, a ? a : "[Unknown]", (long) getpid());
     if (max_sessions && no_sessions >= max_sessions)
         control_block.one_shot = 1;
@@ -1050,7 +1052,7 @@ static void inetd_connection(int what)
                 iochan_setdata(chan, assoc);
                 iochan_settimeout(chan, 60);
                 addr = cs_addrstr(line);
                 iochan_setdata(chan, assoc);
                 iochan_settimeout(chan, 60);
                 addr = cs_addrstr(line);
-                yaz_log(log_session, "Inetd association from %s",
+                yaz_log(log_sessiondetail, "Inetd association from %s",
                         addr ? addr : "[UNKNOWN]");
                 assoc->cs_get_mask = EVENT_INPUT;
             }
                         addr ? addr : "[UNKNOWN]");
                 assoc->cs_get_mask = EVENT_INPUT;
             }