From c06260f7542896052b72c58b1c8ace68124a2ea0 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 1 Aug 2011 13:25:14 -0700 Subject: [PATCH] rgw: quiet down some log messages --- src/rgw/rgw_admin.cc | 2 +- src/rgw/rgw_cache.cc | 8 ++++---- src/rgw/rgw_main.cc | 12 ++++++------ src/rgw/rgw_op.cc | 8 ++++---- src/rgw/rgw_os.cc | 4 ++-- src/rgw/rgw_os_auth.cc | 10 +++++----- src/rgw/rgw_rados.cc | 2 +- src/rgw/rgw_rest_s3.cc | 2 +- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index a7aedbf614f7f..9dadec5979140 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -306,7 +306,7 @@ static int create_bucket(string& bucket, string& user_id, string& display_name, ret = rgw_add_bucket(user_id, bucket); - RGW_LOG(0) << "ret=" << ret << dendl; + RGW_LOG(20) << "ret=" << ret << dendl; if (ret == -EEXIST) ret = 0; diff --git a/src/rgw/rgw_cache.cc b/src/rgw/rgw_cache.cc index 00eb8fbddef4c..4dde65ffe099d 100644 --- a/src/rgw/rgw_cache.cc +++ b/src/rgw/rgw_cache.cc @@ -9,7 +9,7 @@ int ObjectCache::get(string& name, ObjectCacheInfo& info, uint32_t mask) { map::iterator iter = cache_map.find(name); if (iter == cache_map.end()) { - RGW_LOG(0) << "cache get: name=" << name << " : miss" << dendl; + RGW_LOG(10) << "cache get: name=" << name << " : miss" << dendl; return -ENOENT; } @@ -17,10 +17,10 @@ int ObjectCache::get(string& name, ObjectCacheInfo& info, uint32_t mask) ObjectCacheInfo& src = iter->second.info; if ((src.flags & mask) != mask) { - RGW_LOG(0) << "cache get: name=" << name << " : type miss (requested=" << mask << ", cached=" << src.flags << dendl; + RGW_LOG(10) << "cache get: name=" << name << " : type miss (requested=" << mask << ", cached=" << src.flags << dendl; return -ENOENT; } - RGW_LOG(0) << "cache get: name=" << name << " : hit" << dendl; + RGW_LOG(10) << "cache get: name=" << name << " : hit" << dendl; info = src; @@ -29,7 +29,7 @@ int ObjectCache::get(string& name, ObjectCacheInfo& info, uint32_t mask) void ObjectCache::put(string& name, ObjectCacheInfo& info) { - RGW_LOG(0) << "cache put: name=" << name << dendl; + RGW_LOG(10) << "cache put: name=" << name << dendl; map::iterator iter = cache_map.find(name); if (iter == cache_map.end()) { ObjectCacheEntry entry; diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index 21b9b9eaab97c..7313d9049ee3e 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -66,7 +66,7 @@ class RGWProcess { bool _enqueue(FCGX_Request *req) { process->m_fcgx_queue.push_back(req); - RGW_LOG(0) << "enqueued request fcgx=" << hex << req << dec << dendl; + RGW_LOG(20) << "enqueued request fcgx=" << hex << req << dec << dendl; _dump_queue(); return true; } @@ -81,7 +81,7 @@ class RGWProcess { return NULL; FCGX_Request *req = process->m_fcgx_queue.front(); process->m_fcgx_queue.pop_front(); - RGW_LOG(0) << "dequeued request fcgx=" << hex << req << dec << dendl; + RGW_LOG(20) << "dequeued request fcgx=" << hex << req << dec << dendl; _dump_queue(); return req; } @@ -91,12 +91,12 @@ class RGWProcess { void _dump_queue() { deque::iterator iter; if (process->m_fcgx_queue.size() == 0) { - RGW_LOG(0) << "RGWWQ: empty" << dendl; + RGW_LOG(20) << "RGWWQ: empty" << dendl; return; } - RGW_LOG(0) << "RGWWQ:" << dendl; + RGW_LOG(20) << "RGWWQ:" << dendl; for (iter = process->m_fcgx_queue.begin(); iter != process->m_fcgx_queue.end(); ++iter) { - RGW_LOG(0) << "fcgx: " << hex << *iter << dec << dendl; + RGW_LOG(20) << "fcgx: " << hex << *iter << dec << dendl; } } void _clear() { @@ -132,7 +132,7 @@ void RGWProcess::run() for (;;) { FCGX_Request *fcgx = new FCGX_Request; - RGW_LOG(0) << "allocated request fcgx=" << hex << fcgx << dec << dendl; + RGW_LOG(10) << "allocated request fcgx=" << hex << fcgx << dec << dendl; FCGX_InitRequest(fcgx, s, 0); int ret = FCGX_Accept_r(fcgx); if (ret < 0) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 1253c38b5906a..ead6b96c45bb5 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -907,8 +907,8 @@ static int rebuild_policy(ACLOwner *owner, RGWAccessControlPolicy& src, RGWAcces dest_owner.set_id(owner->get_id()); dest_owner.set_name(owner_info.display_name); - RGW_LOG(0) << "owner id=" << owner->get_id() << dendl; - RGW_LOG(0) << "dest owner id=" << dest.get_owner().get_id() << dendl; + RGW_LOG(20) << "owner id=" << owner->get_id() << dendl; + RGW_LOG(20) << "dest owner id=" << dest.get_owner().get_id() << dendl; RGWAccessControlList& src_acl = src.get_acl(); RGWAccessControlList& acl = dest.get_acl(); @@ -1242,7 +1242,7 @@ void RGWCompleteMultipart::execute() goto done; } if (iter->second.compare(obj_iter->second.etag) != 0) { - RGW_LOG(0) << "part: " << iter->first << " etag: " << iter->second << dendl; + RGW_LOG(0) << "etag mismatch: part: " << iter->first << " etag: " << iter->second << dendl; ret = -ERR_INVALID_PART; goto done; } @@ -1255,7 +1255,7 @@ void RGWCompleteMultipart::execute() buf_to_hex((unsigned char *)final_etag, sizeof(final_etag), final_etag_str); snprintf(&final_etag_str[CEPH_CRYPTO_MD5_DIGESTSIZE * 2], sizeof(final_etag_str) - CEPH_CRYPTO_MD5_DIGESTSIZE * 2, "-%lld", (long long)parts->parts.size()); - RGW_LOG(0) << "calculated etag: " << final_etag_str << dendl; + RGW_LOG(10) << "calculated etag: " << final_etag_str << dendl; etag_bl.append(final_etag_str, strlen(final_etag_str) + 1); diff --git a/src/rgw/rgw_os.cc b/src/rgw/rgw_os.cc index 2c6bc798c1ddc..edecf55f70b42 100644 --- a/src/rgw/rgw_os.cc +++ b/src/rgw/rgw_os.cc @@ -110,14 +110,14 @@ bool rgw_verify_os_token(req_state *s) string openstack_user = s->os_user; - RGW_LOG(0) << "openstack user=" << s->os_user << dendl; + RGW_LOG(10) << "openstack user=" << s->os_user << dendl; if (rgw_get_user_info_by_openstack(openstack_user, s->user) < 0) { RGW_LOG(0) << "couldn't map openstack user" << dendl; return false; } - RGW_LOG(0) << "user_id=" << s->user.user_id << dendl; + RGW_LOG(10) << "user_id=" << s->user.user_id << dendl; return true; } diff --git a/src/rgw/rgw_os_auth.cc b/src/rgw/rgw_os_auth.cc index 0416a45405dd1..a382ea6f10206 100644 --- a/src/rgw/rgw_os_auth.cc +++ b/src/rgw/rgw_os_auth.cc @@ -61,7 +61,7 @@ int rgw_os_verify_signed_token(const char *token, RGWUserInfo& info) int len = strlen(token); if (len & 1) { - RGW_LOG(0) << "invalid token length" << dendl; + RGW_LOG(0) << "failed to verify token: invalid token length len=" << len << dendl; return -EINVAL; } @@ -84,7 +84,7 @@ int rgw_os_verify_signed_token(const char *token, RGWUserInfo& info) ::decode(nonce, iter); ::decode(expiration, iter); } catch (buffer::error *err) { - RGW_LOG(0) << "failed to decode token" << dendl; + RGW_LOG(0) << "failed to decode token: caught exception" << dendl; return -EINVAL; } if (expiration < ceph_clock_now(g_ceph_context)) { @@ -95,7 +95,7 @@ int rgw_os_verify_signed_token(const char *token, RGWUserInfo& info) if ((ret = rgw_get_user_info_by_openstack(os_user, info)) < 0) return ret; - RGW_LOG(0) << "os_user=" << os_user << dendl; + RGW_LOG(10) << "os_user=" << os_user << dendl; bufferlist tok; ret = build_token(os_user, info.openstack_key, nonce, expiration, tok); @@ -110,7 +110,7 @@ int rgw_os_verify_signed_token(const char *token, RGWUserInfo& info) if (memcmp(tok.c_str(), bl.c_str(), tok.length()) != 0) { char buf[tok.length() * 2 + 1]; buf_to_hex((const unsigned char *)tok.c_str(), tok.length(), buf); - RGW_LOG(0) << "tokens mismatch tok=" << buf << dendl; + RGW_LOG(0) << "WARNING: tokens mismatch tok=" << buf << dendl; return -EPERM; } @@ -121,7 +121,7 @@ void RGW_OS_Auth_Get::execute() { int ret = -EPERM; - RGW_LOG(0) << "RGW_OS_Auth_Get::execute()" << dendl; + RGW_LOG(20) << "RGW_OS_Auth_Get::execute()" << dendl; const char *key = s->env->get("HTTP_X_AUTH_KEY"); const char *user = s->env->get("HTTP_X_AUTH_USER"); diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index bf1eca731fc41..227d1cf1c96f8 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -1173,7 +1173,7 @@ int RGWRados::append_async(rgw_obj& obj, size_t size, bufferlist& bl) int RGWRados::distribute(bufferlist& bl) { - RGW_LOG(0) << "sending notification oid=" << notify_oid << " bl.length()=" << bl.length() << dendl; + RGW_LOG(10) << "distributing notification oid=" << notify_oid << " bl.length()=" << bl.length() << dendl; int r = control_pool_ctx.notify(notify_oid, 0, bl); return r; } diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 4621e281353d7..4c284f2543c8a 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -691,7 +691,7 @@ int RGWHandler_REST_S3::authorize() time_t req_sec = s->header_time.sec(); if (req_sec < now - RGW_AUTH_GRACE_MINS * 60 || req_sec > now + RGW_AUTH_GRACE_MINS * 60) { - RGW_LOG(0) << "req_sec=" << req_sec << " now=" << now << "; now - RGW_AUTH_GRACE_MINS=" << now - RGW_AUTH_GRACE_MINS * 60 << "; now + RGW_AUTH_GRACE_MINS=" << now + RGW_AUTH_GRACE_MINS * 60 << dendl; + RGW_LOG(10) << "req_sec=" << req_sec << " now=" << now << "; now - RGW_AUTH_GRACE_MINS=" << now - RGW_AUTH_GRACE_MINS * 60 << "; now + RGW_AUTH_GRACE_MINS=" << now + RGW_AUTH_GRACE_MINS * 60 << dendl; RGW_LOG(0) << "request time skew too big now=" << utime_t(now, 0) << " req_time=" << s->header_time << dendl; return -ERR_REQUEST_TIME_SKEWED; } -- 2.39.5