]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: log civetweb messages
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 1 Aug 2014 21:09:48 +0000 (14:09 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 14 Aug 2014 23:06:50 +0000 (16:06 -0700)
Handle the civetweb log_message callback, divert messages into our debug
log.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_main.cc

index 3443a6195df2899f6b76a38735a87faa983f3142..31b6b54da4be10cb4876d2416d358a2badc17cbc 100644 (file)
@@ -699,6 +699,11 @@ static int civetweb_callback(struct mg_connection *conn) {
   return 1;
 }
 
+static int civetweb_log_callback(const struct mg_connection *conn, const char *buf) {
+  dout(10) << "civetweb: " << (void *)conn << ": " << buf << dendl;
+  return 0;
+}
+
 #ifdef HAVE_CURL_MULTI_WAIT
 static void check_curl()
 {
@@ -937,6 +942,7 @@ public:
     struct mg_callbacks cb;
     memset((void *)&cb, 0, sizeof(cb));
     cb.begin_request = civetweb_callback;
+    cb.log_message = civetweb_log_callback;
     ctx = mg_start(&cb, &env, (const char **)&options);
 
     if (!ctx) {