]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: separate civetweb log from rgw log
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 21 Aug 2014 23:30:10 +0000 (16:30 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 23 Sep 2014 20:55:48 +0000 (13:55 -0700)
The civetweb log now is independent from the rgw log.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 850242cad749e33e1e6bc008baa75c8ea7eda0c1)

Conflicts:
src/civetweb
src/rgw/rgw_main.cc

src/common/config_opts.h
src/rgw/Makefile.am
src/rgw/rgw_civetweb_log.cc [new file with mode: 0644]
src/rgw/rgw_civetweb_log.h [new file with mode: 0644]
src/rgw/rgw_main.cc

index fe00c76b2051b923fc2f49ae8a94ad41bce56bc4..fb5b41ad72da2b601aa23d0f03cf5b8b66f7adbc 100644 (file)
@@ -92,6 +92,7 @@ SUBSYS(finisher, 1, 1)
 SUBSYS(heartbeatmap, 1, 5)
 SUBSYS(perfcounter, 1, 5)
 SUBSYS(rgw, 1, 5)                 // log level for the Rados gateway
+SUBSYS(civetweb, 1, 10)
 SUBSYS(javaclient, 1, 5)
 SUBSYS(asok, 1, 5)
 SUBSYS(throttle, 1, 1)
index 3d6886d1bf202b503cf816c61d3fe5a6377d0425..6bf9804479d21e95949a50a15cc5e98a9d752734 100644 (file)
@@ -72,6 +72,7 @@ radosgw_SOURCES = \
        rgw/rgw_swift_auth.cc \
        rgw/rgw_loadgen.cc \
        rgw/rgw_civetweb.cc \
+       rgw/rgw_civetweb_log.cc \
        civetweb/src/civetweb.c \
        rgw/rgw_main.cc
 radosgw_CFLAGS = -Icivetweb/include
@@ -158,6 +159,7 @@ noinst_HEADERS += \
        rgw/rgw_bucket.h \
        rgw/rgw_keystone.h \
        rgw/rgw_civetweb.h \
+       rgw/rgw_civetweb_log.h \
        civetweb/civetweb.h \
        civetweb/include/civetweb.h \
        civetweb/src/md5.h
diff --git a/src/rgw/rgw_civetweb_log.cc b/src/rgw/rgw_civetweb_log.cc
new file mode 100644 (file)
index 0000000..720bab5
--- /dev/null
@@ -0,0 +1,14 @@
+#include "common/config.h"
+#include "rgw_common.h"
+
+#include "civetweb/civetweb.h"
+
+#define dout_subsys ceph_subsys_civetweb
+
+
+int rgw_civetweb_log_callback(const struct mg_connection *conn, const char *buf) {
+  dout(10) << "civetweb: " << (void *)conn << ": " << buf << dendl;
+  return 0;
+}
+
+
diff --git a/src/rgw/rgw_civetweb_log.h b/src/rgw/rgw_civetweb_log.h
new file mode 100644 (file)
index 0000000..6c6b2c0
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef CEPH_RGW_CIVETWEB_LOG_H
+#define CEPH_RGW_CIVETWEB_LOG_H
+
+int rgw_civetweb_log_callback(const struct mg_connection *conn, const char *buf);
+
+#endif
index 9bf9f83c1dc2b4602f3105756d5c89b2ce08a295..cb294d7241f689e6968cb25ef36035c71a009dfd 100644 (file)
@@ -54,6 +54,7 @@
 #include "rgw_resolve.h"
 #include "rgw_loadgen.h"
 #include "rgw_civetweb.h"
+#include "rgw_civetweb_log.h"
 
 #include "civetweb/civetweb.h"
 
@@ -928,6 +929,7 @@ public:
     struct mg_callbacks cb;
     memset((void *)&cb, 0, sizeof(cb));
     cb.begin_request = civetweb_callback;
+    cb.log_message = rgw_civetweb_log_callback;
     ctx = mg_start(&cb, &env, (const char **)&options);
 
     if (!ctx) {