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 <yehuda@redhat.com>
This commit is contained in:
Yehuda Sadeh 2014-08-21 16:51:16 -07:00
parent 850242cad7
commit 00c677b4b6
4 changed files with 9 additions and 2 deletions

@ -1 +1 @@
Subproject commit ebf869ab50a070a3580ec4303c2aaf278bd73d24
Subproject commit 92b43ae376fb87b284ae7acf1d459b0008e7d69e

View File

@ -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;
}

View File

@ -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

View File

@ -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) {