From 00c677b4b69f2a37ebeb663a1918d9ea1d974a59 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 21 Aug 2014 16:51:16 -0700 Subject: [PATCH] rgw: use a separate callback for civetweb access log Access log is separate from the regular civetweb logging. Also, changed the log level for the regular logging as it's used mostly for error messages. Signed-off-by: Yehuda Sadeh --- src/civetweb | 2 +- src/rgw/rgw_civetweb_log.cc | 7 ++++++- src/rgw/rgw_civetweb_log.h | 1 + src/rgw/rgw_main.cc | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/civetweb b/src/civetweb index ebf869ab50a07..92b43ae376fb8 160000 --- a/src/civetweb +++ b/src/civetweb @@ -1 +1 @@ -Subproject commit ebf869ab50a070a3580ec4303c2aaf278bd73d24 +Subproject commit 92b43ae376fb87b284ae7acf1d459b0008e7d69e diff --git a/src/rgw/rgw_civetweb_log.cc b/src/rgw/rgw_civetweb_log.cc index 720bab5f32333..e2d8dd9ad015d 100644 --- a/src/rgw/rgw_civetweb_log.cc +++ b/src/rgw/rgw_civetweb_log.cc @@ -7,7 +7,12 @@ int rgw_civetweb_log_callback(const struct mg_connection *conn, const char *buf) { - dout(10) << "civetweb: " << (void *)conn << ": " << buf << dendl; + dout(0) << "civetweb: " << (void *)conn << ": " << buf << dendl; + return 0; +} + +int rgw_civetweb_log_access_callback(const struct mg_connection *conn, const char *buf) { + dout(1) << "civetweb: " << (void *)conn << ": " << buf << dendl; return 0; } diff --git a/src/rgw/rgw_civetweb_log.h b/src/rgw/rgw_civetweb_log.h index 6c6b2c061e332..0fc227a546854 100644 --- a/src/rgw/rgw_civetweb_log.h +++ b/src/rgw/rgw_civetweb_log.h @@ -2,5 +2,6 @@ #define CEPH_RGW_CIVETWEB_LOG_H int rgw_civetweb_log_callback(const struct mg_connection *conn, const char *buf); +int rgw_civetweb_log_access_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 92da3c431c451..f12ef200864b8 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -939,6 +939,7 @@ public: memset((void *)&cb, 0, sizeof(cb)); cb.begin_request = civetweb_callback; cb.log_message = rgw_civetweb_log_callback; + cb.log_access = rgw_civetweb_log_access_callback; ctx = mg_start(&cb, &env, (const char **)&options); if (!ctx) { -- 2.39.5