Merge remote branch 'origin/frontend_log'
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 25 Apr 2012 16:46:22 +0000 (18:46 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 25 Apr 2012 16:46:22 +0000 (18:46 +0200)
etc/config-zoom.xml
etc/config0.xml
src/filter_frontend_net.cpp

index 301173d..5d0fc3d 100644 (file)
       <contentProxy
          config_file="/etc/cf-proxy/cproxy.cfg"
       />
-      <log apdu="true"/>
+      <log apdu="false"/>
       <zoom timeout="20" proxy_timeout="1"/>
     </filter>
   </filters>
   <routes>  
     <route id="start">
       <filter refid="frontend"/>
-      <filter type="log">
-        <message>F</message>
-       <category apdu="false" session="true"/>
-      </filter>
       <filter type="sru_z3950"/>
       <filter type="session_shared">
         <resultset ttl="0" restart="false"/>
index 37af4c6..717f4ed 100644 (file)
@@ -6,6 +6,7 @@
   <filters>
     <filter id="frontend" type="frontend_net">
       <port>@:9000</port>
+      <message>FN</message>
     </filter>
   </filters>
   <routes>  
index 21f8e8b..e94998c 100644 (file)
@@ -32,6 +32,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include <yazpp/limit-connect.h>
 #include <yaz/timing.h>
 #include <yaz/log.h>
+#include "gduutil.hpp"
 
 #include <iostream>
 
@@ -212,11 +213,17 @@ void mp::ThreadPoolPackage::result(const char *t_info)
     {
         yaz_timing_stop(timer);
         double duration = yaz_timing_get_real(timer);
+        Z_GDU *z_gdu = gdu->get();
 
         std::ostringstream os;
         os  << m_msg_config << " "
             << *m_package << " "
-            << std::fixed << std::setprecision (6) << duration;
+            << std::fixed << std::setprecision (6) << duration << " ";
+
+        if (z_gdu) 
+            os << *z_gdu;
+        else
+            os << "-";
         
         yaz_log(YLOG_LOG, "%s %s", os.str().c_str(), t_info);
     }
@@ -270,6 +277,19 @@ void mp::ZAssocChild::recv_GDU(Z_GDU *z_pdu, int len)
                                                           m_msg_config);
     p->copy_route(*m_package);
     p->request() = yazpp_1::GDU(z_pdu);
+
+    if (m_msg_config)
+    {
+        if (z_pdu)          
+        {
+            std::ostringstream os;
+            os  << m_msg_config << " "
+                << *p << " "
+                << "0.000000" << " " 
+                << *z_pdu;
+            yaz_log(YLOG_LOG, "%s", os.str().c_str());
+        }
+    }
     m_thread_pool_observer->put(tp);  
 }