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.80.8~64^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bd0a91343ce70d71acced753688a502b7e8b552e;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 (cherry picked from commit 850242cad749e33e1e6bc008baa75c8ea7eda0c1) Conflicts: src/civetweb src/rgw/rgw_main.cc --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index fe00c76b205..fb5b41ad72d 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 3d6886d1bf2..6bf9804479d 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 = -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 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 9bf9f83c1dc..cb294d7241f 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -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) {