From: Yehuda Sadeh Date: Thu, 21 Aug 2014 23:30:10 +0000 (-0700) Subject: rgw: separate civetweb log from rgw log X-Git-Tag: v0.85~8^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=850242cad749e33e1e6bc008baa75c8ea7eda0c1;p=ceph.git rgw: separate civetweb log from rgw log The civetweb log now is independent from the rgw log. Signed-off-by: Yehuda Sadeh --- diff --git a/src/civetweb b/src/civetweb index c39d732637a..ebf869ab50a 160000 --- a/src/civetweb +++ b/src/civetweb @@ -1 +1 @@ -Subproject commit c39d732637a813ab5d4386a6167444dd6a235e82 +Subproject commit ebf869ab50a070a3580ec4303c2aaf278bd73d24 diff --git a/src/common/config_opts.h b/src/common/config_opts.h index e79f4ad2b2a..b189d5cc20e 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -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) diff --git a/src/rgw/Makefile.am b/src/rgw/Makefile.am index c1ac7f4c082..06e56c69283 100644 --- a/src/rgw/Makefile.am +++ b/src/rgw/Makefile.am @@ -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 = -I$(srcdir)/civetweb/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 index 00000000000..720bab5f323 --- /dev/null +++ b/src/rgw/rgw_civetweb_log.cc @@ -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 index 00000000000..6c6b2c061e3 --- /dev/null +++ b/src/rgw/rgw_civetweb_log.h @@ -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 diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index 31b6b54da4b..92da3c431c4 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -57,6 +57,7 @@ #include "rgw_resolve.h" #include "rgw_loadgen.h" #include "rgw_civetweb.h" +#include "rgw_civetweb_log.h" #include "civetweb/civetweb.h" @@ -699,11 +700,6 @@ 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() { @@ -942,7 +938,7 @@ public: struct mg_callbacks cb; memset((void *)&cb, 0, sizeof(cb)); cb.begin_request = civetweb_callback; - cb.log_message = civetweb_log_callback; + cb.log_message = rgw_civetweb_log_callback; ctx = mg_start(&cb, &env, (const char **)&options); if (!ctx) {